View image pixel intensity

How to view the pixel intensity of an image in Matlab by moving the mouse over the image?

I used:

imshow(imread('image.jpg')); 

But there is no way to view the pixel intensities of each pixel in the image.

For instance,

  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.

Is there any other option to view. Or do I need a code to view it?

+4
source share
3 answers

you have impixelinfo and impixelinfoval to display interactive information.

0
source

Another option that is more interactive,

  imtool(imread('image.jpg')); % For GrayScale Image imtool(rgb2gray(imread('image.jpg'))); % For RGB Image 
+2
source

If you want to create an intensity map, you can use MATLAB rgb2gray . This converts the n-by-m-3 RGB array you received from imread to an n-by-m matrix that contains pixel intensities.

Then you can point the interactive data cursor to this intensity matrix for the current mouse coordinates.

+1
source

Source: https://habr.com/ru/post/1490634/


All Articles