How do i obtain a single pixel value in a grayscale image by clicking on it?
5 views (last 30 days)
Show older comments
I have a GUI snd i need to obtain a pixel value of one of my images so i can set a threshold for segmentation. I only want one pixel value and want the user to click on the picture to find the specific value. Does ginput do this or is there something to ginput that i can use?
0 Comments
Accepted Answer
Image Analyst
on 23 Apr 2013
See my interactive thresholding app : http://www.mathworks.com/matlabcentral/fileexchange/29372-thresholding-an-image. It should work beautifully for all type of grayscale images - let me know if it doesn't. Other than that, use ginput() to get the column,row coordinates
[column, row] = ginput(1);
grayLevel = image(row, column);
or use impixelinfo() to get the gray level "live" as you move the mouse around over the image.
7 Comments
Image Analyst
on 24 Apr 2013
Well, then you'd better track down why the BlueFish image is basically null.
More Answers (0)
See Also
Categories
Find more on Basic Display in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!