In below we give the example for get the image pixel from mouse click. Just go-through this code you definitely understand. Here main syntax is ginput. Its get the x and y coordinates from Figure window.
Syntax as follows
[x y] = ginput(n); % n is n clicks
Then example as follows
input_img = imread('vivekananda.jpg');
imshow(input_img);
[imr imc] = size(input_img);
[x y] = ginput(1); % one click from figure window then get x and y coordinates
org_x = imc + (x - imc); % x coordinates converted into image x - original pixel value
org_y = imr + (y - imr); % y coordinates converted into image y - original pixel value
The out put as follows
Related Search : Matlab get X and Y values form Image Figure , Matlab get Image Pixel from Mouse click,Matlab gintput best example,Matlab get X and Y values form Image,Matlab gintput get X and Y values form Image
No comments:
Post a Comment