Reputation: 793
How to view the pixel intensities of an image in matlab by moving the mouse pointer over the image?
I used:
imshow(imread('image.jpg'));
But there is no option to view the pixel intensities of each pixel in the image.
For example,
In MS-paint, while moving the mouse pointer
over the image we can see the location of
the pixel such as (20, 117) at the status bar.
But I need to see the pixel intensity instead.
Is there any other option to view it. Or I need to code to view it?
Upvotes: 4
Views: 2818
Reputation: 793
One other option which is more interactive is
imtool(imread('image.jpg')); % For GrayScale Image
imtool(rgb2gray(imread('image.jpg'))); % For RGB Image
Upvotes: 2
Reputation: 114816
you have impixelinfo
and impixelinfoval
for showing interactive information.
Upvotes: 0
Reputation: 38032
If you want to create an intensity map, you can use MATLAB's rgb2gray
. This will convert the n-by-m-by-3 RGB array you got from imread
to an n-by-m matrix which contains the pixel intensities.
You can then point the interactive data cursor to this intensity matrix for the current mouse coordinates.
Upvotes: 1