Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
How to get pixel intensity values of an image

Subject: How to get pixel intensity values of an image

From: Hendy Sutomo

Date: 4 Jan, 2010 05:23:04

Message: 1 of 9

Hi all,

I'm a beginner in matlab.
I have a grayscale image and I would like to get the intensity value of every pixels in the image.
As far as I know, imhist will only show a graph of the intensity value. Instead, I want to retrieve the value (i.e the integer value).

Thanks in advance

Subject: How to get pixel intensity values of an image

From: us

Date: 4 Jan, 2010 07:54:04

Message: 2 of 9

"Hendy Sutomo" <hendy.sow@gmail.com> wrote in message <hhrtvo$2g3$1@fred.mathworks.com>...
> Hi all,
>
> I'm a beginner in matlab.
> I have a grayscale image and I would like to get the intensity value of every pixels in the image.
> As far as I know, imhist will only show a graph of the intensity value. Instead, I want to retrieve the value (i.e the integer value).
>
> Thanks in advance

but - the values are already there: in your matrix...

us

Subject: How to get pixel intensity values of an image

From: Hendy Sutomo

Date: 4 Jan, 2010 08:07:03

Message: 3 of 9

Which matrix u mean?
sorry, I'm a total noob here

Thanks for ur help

Subject: How to get pixel intensity values of an image

From: us

Date: 4 Jan, 2010 08:16:03

Message: 4 of 9

"Hendy Sutomo" <hendy.sow@gmail.com> wrote in message <hhs7j7$9if$1@fred.mathworks.com>...
> Which matrix u mean?
> sorry, I'm a total noob here
>
> Thanks for ur help

well, look here...

http://www.mathworks.com/access/helpdesk/help/techdoc/learn_matlab/f3-1186.html

us

Subject: How to get pixel intensity values of an image

From: Hendy Sutomo

Date: 4 Jan, 2010 08:26:03

Message: 5 of 9

Well.....

what i did is load an grayscale image, and use impixel to determine the value of pixels. But now i need the intensity value of each pixels.

I dont really get the information from the link u gave me.
Thanks for ur help


-hendy-

Subject: How to get pixel intensity values of an image

From: ImageAnalyst

Date: 4 Jan, 2010 11:10:52

Message: 6 of 9

-hendy-
If you have an image, the image is in a numerical variable that is an
array. The elements of that array ARE your intensity values.

For example:

% Read in standard MATLAB demo image.
grayImage = imread('cameraman.tif');
imshow(grayImage, []);
title('Original Grayscale Image');
set(gcf, 'Position', get(0,'Screensize')); % Maximize figure.

Let's say you want the intensity value at row 100, column 230. Well
then you'd just say
intensityValue = grayImage(100, 230);

It's as simple as that.

Subject: How to get pixel intensity values of an image

From: Hendy Sutomo

Date: 4 Jan, 2010 12:56:03

Message: 7 of 9

Thanks alot ImageAnalyst.
Now I get the idea.

-hendy-

Subject: How to get pixel intensity values of an image

From: Luca

Date: 22 Dec, 2011 12:59:08

Message: 8 of 9

Hi,

Im also a new user of matlab
starting from this:

imshow(grayImage, []);

can you explain what i should put instead of []
is not really clear to me and i didn’t find something usefull in the net for understanding it

thank you very much
Luca

ImageAnalyst <imageanalyst@mailinator.com> wrote in message <df97e1ed-d029-4a4b-ae46-0b32c140497d@f5g2000yqh.googlegroups.com>...
> -hendy-
> If you have an image, the image is in a numerical variable that is an
> array. The elements of that array ARE your intensity values.
>
> For example:
>
> % Read in standard MATLAB demo image.
> grayImage = imread('cameraman.tif');
> imshow(grayImage, []);
> title('Original Grayscale Image');
> set(gcf, 'Position', get(0,'Screensize')); % Maximize figure.
>
> Let's say you want the intensity value at row 100, column 230. Well
> then you'd just say
> intensityValue = grayImage(100, 230);
>
> It's as simple as that.

Subject: How to get pixel intensity values of an image

From: Nuwan Liyanage

Date: 25 Mar, 2013 06:31:05

Message: 9 of 9

ImageAnalyst <imageanalyst@mailinator.com> wrote in message <df97e1ed-d029-4a4b-ae46-0b32c140497d@f5g2000yqh.googlegroups.com>...
> -hendy-
> If you have an image, the image is in a numerical variable that is an
> array. The elements of that array ARE your intensity values.
>
> For example:
>
> % Read in standard MATLAB demo image.
> grayImage = imread('cameraman.tif');
> imshow(grayImage, []);
> title('Original Grayscale Image');
> set(gcf, 'Position', get(0,'Screensize')); % Maximize figure.
>
> Let's say you want the intensity value at row 100, column 230. Well
> then you'd just say
> intensityValue = grayImage(100, 230);
>
> It's as simple as that.

Hi all,
I want to retrieve the intensity value matrix of a ROI in a gray scale image into a given matrix, say "I[]". And to get the average intensity value of that particular ROI. How can I do this?
Thanks in advance

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us