Can I plot a dot at a specified pixel location?

조회 수: 11 (최근 30일)
zy
zy 2014년 7월 5일
댓글: Image Analyst 2017년 10월 6일
I have a set of pixel locations, and I need to draw a dot at each of these know pixel locations. For example, I need to draw a dot in the figure at a point with pixel location (640,400), and then draw a dot at another point with pixel location (640,600).
The screen pixel size is 640x640.
Thank you.

채택된 답변

Image Analyst
Image Analyst 2014년 7월 5일
if ndims(yourImage == 1)
% Grayscale image.
yourImage(row, column) = 255;
else
% Color image
yourImage(rows, column, :) = 255; % or [255,255,255] if that doesn't work.
end
  댓글 수: 8
Safwan Ibrahim
Safwan Ibrahim 2017년 10월 5일
"or set a range of pixels, like a rectangle, instead of just one small pixel." Can you please tell us how can you do that ?
Image Analyst
Image Analyst 2017년 10월 6일
Like this
yourImage(row1:row2, column1:column2, :) = 255; % or [255,255,255] if that doesn't work.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by