Can I plot a dot at a specified pixel location?
이 질문을 팔로우합니다.
- 팔로우하는 게시물 피드에서 업데이트를 확인할 수 있습니다.
- 정보 수신 기본 설정에 따라 이메일을 받을 수 있습니다.
오류 발생
페이지가 변경되었기 때문에 동작을 완료할 수 없습니다. 업데이트된 상태를 보려면 페이지를 다시 불러오십시오.
이전 댓글 표시
0 개 추천
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
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
The above is to write it into an image. If you just want to put a dot into the overlay above the image but don't want to actually change the value of the image at that location, use plot():
hold on;
plot(x, y, 'w.', 'MarkerSize', 10);
zy, did either of those work for you?
Thank you for your help. But it seems that those did not work. I am still trying to get the result I need.
Do you have any other suggestions?
Thank you.
Can you explain more what "did not work" means to you? I know they do put a dot in and on the image so I'm not sure why you say they don't work. Show me your script so I can see what you did.
zy
2014년 7월 11일
Is it correct that your way is to plot a dot at a pixel location by adjusting the brightness level ?
I downloaded an gray scale photo image, and applied your suggested code, but I did not find any change in the image. I don't quite understand.
marilyn=imread('marilyn.jpg'); figure if ndims(marilyn == 1) % Grayscale image. marilyn(300, 454) = 255; else % Color image marilyn(300, 454, :) = 255; % or [255,255,255] if that doesn't work. end imshow(marilyn);
It might be possible that the image is demagnified so much that the one pixel you set was subsampled out when it went to display it. Try a different pixel, or enlarge your image by maximizing it, or use a smaller image, or set a range of pixels, like a rectangle, instead of just one small pixel.
"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 ?
Like this
yourImage(row1:row2, column1:column2, :) = 255; % or [255,255,255] if that doesn't work.
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Image Arithmetic에 대해 자세히 알아보기
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 MathWorks 사이트 방문이 최적화되지 않았습니다.
미주
- América Latina (Español)
- Canada (English)
- United States (English)
유럽
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
