フィルターのクリア

how can I draw a grid over a specified region of the image

3 ビュー (過去 30 日間)
ZhG
ZhG 2013 年 11 月 6 日
回答済み: Image Analyst 2013 年 11 月 6 日
For example, I have an image of 400*360. I want to draw small grids over a region of the image. E.g. draw small grids of 20*20 started from (50, 60) and until (300, 280). How can I do this?

回答 (1 件)

Image Analyst
Image Analyst 2013 年 11 月 6 日
You can do it in the overlay, with line(),
for row = 50 : 20 : 300
line([1, 360], [row, row];
end
for column = 60 : 20 : 280
line([column , column ], [1, 400];
end
or you can burn it into the image like this:
for row = 50 : 20 : 300
grayImage(row, :) = 255;
end
for column = 60 : 20 : 280
grayImage(:, column) = 255;
end

カテゴリ

Help Center および File ExchangeGeometric Transformation and Image Registration についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by