How to get onclick coordinate pixel value and location from an image?
Mostrar comentarios más antiguos
Hey frndz, I am new in Matlab. Since 3months ago I am using matlab. Within these 3 months I just learned some matrix manipulation functionm addition, string handling etc. So I need all of your help. Please please help me............... How to get onclick coordinate pixel value and location from an image? Actually I want to get some location(x,y) and corresponding pixel value after clicking on image. how can I do this????????
1 comentario
Xylo
el 24 de Feb. de 2014
Respuesta aceptada
Más respuestas (2)
Image Analyst
el 24 de Feb. de 2014
2 votos
If you don't need the value in your code but just want to interactive view the x,y and RGB as you mouse over the image, you can use impixelinfo().
1 comentario
Xylo
el 25 de Feb. de 2014
Alberto Zafra Navarro
el 5 de Feb. de 2024
Editada: Alberto Zafra Navarro
el 5 de Feb. de 2024
According to ChatGPT is easier to do:
function pts = readPoints(image, n)
%readPoints Read manually-defined points from image
% POINTS = READPOINTS(IMAGE, N) reads up to N points only.
imshow(image); % display image
[x,y] = ginput(n);
pts = [x y];
end
Categorías
Más información sobre Read, Write, and Modify Image en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
