How to get pixel intensity values of an image

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
0
Hendy
1/4/2010 5:23:04 AM
comp.soft-sys.matlab 207294 articles. 1 followers. lunamoonmoon (258) is leader. Post Follow

8 Replies
3757 Views

Similar Articles

[PageSpeed] 56
"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
1
us
1/4/2010 7:54:04 AM
Which matrix u mean?
sorry, I'm a total noob here

Thanks for ur help
0
Hendy
1/4/2010 8:07:03 AM
"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
0
us
1/4/2010 8:16:03 AM
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-
0
Hendy
1/4/2010 8:26:03 AM
-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.
0
ImageAnalyst
1/4/2010 11:10:52 AM
Thanks alot ImageAnalyst.
Now I get the idea.

-hendy-
1
Hendy
1/4/2010 12:56:03 PM
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.
1
12/22/2011 12:59:08 PM
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
0
3/25/2013 6:31:05 AM
Reply:
Similar Artilces:

FAQ - Etiquette
There are several FAQs about the Oracle database scattered around the Internet, and many ways of finding answers to the simpler questions about Oracle very quickly. The following list is a suggestion of where you might find answers to questions that you feel should have an easy answer. The Co-operative Oracle Users' FAQ http://www.jlcomp.demon.co.uk/faq/ind_faq.html The archive for this news group http://www.google.com select the GROUPS tab then work through the list to comp -> databases -> oracle A search engine for searching the manuals for current versions...

How to get a vendor to listen to you
I don't know how much of this is true or just conjecture, but it does paint an interesting picture about how to get support for a platform, despite political repercussions. Yousuf Khan http://www.theinquirer.net/?article=12797 ...

Spammer getting through my NAT router?
I have a home network that I thought was pretty secure. It uses an old Macintosh running the NAT program IPNetRouter. Sometimes I use the FTP or web server function of IPNetRouter, but fortunately no one writes viruses for old out&#8211;of-date Macs these days and I have never had a problem. These are currently turned off. I am upstairs running Windows XP with ZoneAlarm Pro (mostly to check for anything I don&#8217;t know about going out). I was surprised to find a few rare cases of ICMP packets coming in from the outside and reaching my PC. Most of these were responses to pings initi...

How to get combinations of a matrix
hello, I have R=[ 0 1 1 0 ] means 2 number are there and 4 places in R. I need 16 different R combinations. can anyone help me??? Thanks Ankur Ankur Garg wrote: > > > hello, > > I have R=[ 0 1 1 0 ] > means 2 number are there and 4 places in R. > > I need 16 different R combinations. > > can anyone help me??? > > Thanks > Ankur I'm not sure if I've understood your assignment properly, but this gives an interesting output that might be sort of what you want. str2num(reshape([reshape(dec2bin(0:15)',1,64); char(ones(1,64)*32)],8,16)') ...

Get the pid of a os.startfile(filename)
Hi to all, How can I get the Process ID (PID) of an application started because of os.startfile(filename)? Or, better, How can I get the PID of a running program, suposing I know the name of the running application? Many thanks. Daniel Hi ! With W2K or WXP : tasklist /FI "IMAGENAME eq exename.exe" And, with Python, how capture this information : def findPID(exename): import os a = os.popen4('tasklist /FI "IMAGENAME eq '+exename+'"') a[0].flush() try: info=a[1].readlines()[3].split() except: info=[exename...

LISP script giving me double return value
Hi all, I have banged my head against the wall trying to figure out what the heck is going on with my script, but to no avail. All I want is for this script to have as a return value "PORTTRAI" or "LANDSCAPE" (without the quotes). Instead, I get anything but, depending on the specifics of the coding. The closest I can get it is to output PORTRAIT"PORTRAIT" or LANDSCAPE"LANDSCAPE" WTF?! I guess I'm just not understanding how LISP (or AutoLISP more specifically) returns funtion values to the command line. Here's my code: ; Define th...

How could I get two desktop Macs in two apartments of the same building to share the same contents?
How could I get two desktop Macs in two apartments of the same building to share the same contents, so that if I change the contents of one computer, the changes are reflected in the other computer? I would be the only person operating the computers. In both apartments I want to operate printers connected to the desktop Macs. I have an Airport Extreme and an Airport Express already hooked up to my existing Mac, so I'm wondering how I could extend my network into the second apartment, which is in a different apartment of the same building. Robert On 2013-03-18, Robert Montgo...

I Keep Getting and "unknown database" error when I open my program that is using Flashfiler
Hi, I have been using AccuEvents for my entertainment company over the past= 6 years or so. I'm not very good working with this Flashfiler server, so = I try not to make changes. However, due to a problem with one of the compu= ters on my network tried to make changes for the software to work. Now I k= eep getting an "unknown database" error when I open up the software after I= 've started the server. I have gone both thru the tcpi/int and single serv= er steps, but it keeps coming back with "unknown database". Can someone he= lp me solve this? Al...

tiling and rendering tiff image file and to display through openGL
hi i need help i want 2 render a high resolution image but not exactly the power of 2 how can i read the image kindly help me in this regard i am reading a tiff file using GDAL(geospatial data abstract lib) and the file is actually a gray and white map file kindly help soon i have 3 days to complete it i am fimiliar about the tiling method but how to do that inVC++ my image is 12890*8970 resolution thankx ...

sort and get index?
In matlab, the sort function returns two things: [a,b]=sort([5, 8, 7]) a = 5 7 8 b = 1 3 2 where a is the sorted result, and b is the corresponding index. Is there C++ code available to achieve this? Better compatible with STL vector. Thanks "b83503104" <b83503104@yahoo.com> wrote... > In matlab, the sort function returns two things: > > [a,b]=sort([5, 8, 7]) > > a = 5 7 8 > b = 1 3 2 > > where a is the sorted result, and b is the corresponding index. > Is there C++ code available to achieve this? Probably. You co...

Cannot get PiCTeX to process an example file.
Hi All, I bought the PiCTeX manual from PCTeX and copied the LaTeX code (see below) from page 71 of the manual. I guarantee there are no typos in my copying. I also bought the LaTeX CD from TeXnicCenter and use PiCTeX which came on that CD. When I run the code below through the LaTeX compiler from TeXnicCenter I get the errors: ! Undefined control sequence. <argument> \fiverm l.2566 \setplotsymbol({\fiverm .}) ! Undefined control sequence. <argument> \fiverm l.3102 \setshadesymbol ({\fiverm .}) ! Undefined control sequence. \ninepoint I have used TeXnicCent...

selecting elements of an array valued function
Hello, I am trying to use array-valued functions for the first time, and I have a problem. I would like to directly call an element from the results of the function, and I can't figure out the syntax. I have a rank-3 array valued function called dimensions() and I send it some derived data called panels. So I have the statement: dimensions(panels) Now, what if I want to specify the first element of this array? dimensions(panels)(1) isn't working and I've tried a few other permutations with parentheses and such. Is there a way to accomplish what I'm trying to do? Thanks, Be...

difference between chan gets / gets
Hi ! What difference between command chan gets and gets, chan puts and puts ? Many thanks ! serge_darin@mail.ru <serge_darin@mail.ru> wrote: > What difference between command chan gets and gets, chan puts and > puts ? They are supposed to be the same. puts is here for compatibility (and for those too lazy to write those extra 5 chars, like me), whereas chan is an attempt to have related functionality together in a single command. If you're old to tcl, you'll likely be used to top-level "puts", whereas if you're new to tcl, you're more likely to memo...

walking dead pixel lenovo t60
Hi, Just few days after my new lenovo arrived I experienced first dead pixel on its display. I thought it's dead, but... a few minutes later he moved to a completely different location. Huh... Now I've found a simple correlation: when such pixel appears, I can click middle button of trackpoint and it disappears. Anyone experienced something similar? Btw. I am completely not happy with the display - no matter if I choose 16bit or 32bit colors - areas of plain color are dithered (visible mostly at acute angle - e.g. from the bottom). It is 14" 1400x1050 and ATI X1400 video adapt...

getting rid of a while(1) "poll"
Typical problem where a while(1) consumes gobs of CPU. Not as straightforward (to me) to figure out how to replace it with something more CPU friendly. The overall system has three daemons: 1) suck_packets_d 2) first_order_packet_filter_and_packet_buffer_d 3) extract_interesting_packet_features_and_generate_report_d Using some sort of blocking calls in 1) or 2) seems like a bad idea, because packet volume can be high and I want to keep up with it as much as possible. I could use some help thinking this through if anyone is so inclined. C / Linux pseudocode for daemon (2) (biggest ...

[telecom] Woman allegedly records own arrest, gets accused of wiretapping
Woman allegedly records own arrest, gets accused of wiretapping Massachusetts wiretapping law prohibits secretly recording police. by David Kravets May 11 2014 Ars Technica A Massachusetts woman faces charges of allegedly using a hidden mobile phone to audio-record her own suspicion-of-disorderly-conduct arrest. .... http://arstechnica.com/tech-policy/2014/05/woman-allegedly-records-own-arrest-gets-accused-of-wiretapping/ Per Monty Solomon: >Massachusetts wiretapping law prohibits secretly recording police. Can somebody explain the rationale for such laws? -- P...

Get Rich
Take advantage of a great deal ...

Process getting terminated
I am facing a very strange problem. We have a process that is getting terminated without giving any clue as to how it got terminated. There are 3 threads in the process and my logs indicate that each of them was in a waiting state when the process got terminated. I have put __try __except inside each of the top level functions being executed by the threads so that I do not miss any exception if any which might cause the process to be terminated. I hooked the ExitProcess function at the very beginning (inside winmain before the other threads are created) to figure out if any thread was ...

Setting 'default' values in a grid
Hi, I have a simple wxGrid app which uses the wxGrid/wxTable framework. I noticed, that I'm unable to set a (e.g. floating point) value to 0.0. I analyzed the code and I changed line 1016 in grid.cpp (2.4.1) to not check the current value with the old value which gives me exactly the behaviour I want: if ( (text.IsEmpty() || text.ToDouble(&value)) /*&& (value != m_valueOld)*/ ) Wouldn't be that behaviour something that a user would expect? I assume similar changed are neccessary for other data types as well. Remarks? Thomas ...

Passing a value
Hopefully, this will not be as bad as passing a kidney stone. :-) Anyone know how to pass a value from a VB6 exacutable to a VBScript file (*.vbs)? David dhodgkins@chestnut.org (David) wrote in message news:<83b47ff1.0404010724.44197e0f@posting.google.com>... > Hopefully, this will not be as bad as passing a kidney stone. :-) > > Anyone know how to pass a value from a VB6 exacutable to a VBScript file (*.vbs)? if you pass the argument on the command line the WScript.Arguments collection can be used in the script to get the info butlerbob@earthlink.net (Bob Butler) wrote in...

2mg image Disk to real disk from SE/30
Hi, Is there any EASY way/tool to write a 2mg disk image to a real disk from an SE/30 (under 7.6.1) with an 800k external drive ? I'm struggling to find such tools.... (No, I do not want to use ADT) I'm also struggling to copy 142 .DSK image disk to a PRODOS formatted 3.5 disk form the same SE/30. If I copy those disk image from the finder, put the disk in my Apple II, Copy II Plus send me IO ERROR Block $FAC4 while copying or veryfing. There is no "$FAC4" block on a 3.5 800k disk.... It was working that way with GS/OS.... Jerome On Saturday, Apr...

How can I get the mean of all elements of a 2D Array?
I found a VI to extract the minimal and maximal value of a array, but not the mean. Is there another possibility? Thanks Simon Use the Mean function.:smileywink: On the function palette, right at the very top, is a button called 'Search'. "Mean" is such a simple function, you should make your own. The following code works for 2D, 3D, 4D, etc. arrays. :D <img src="http://forums.ni.com/attachments/ni/170/198999/1/2Dmean.png"> (You might suggest to NI that "mean" should be made polymorphic with respect to array dimensionality.)Message Edited by alte...

How get on a computer from a lan?
I have a pc IBM Netvista and I know that it's possible start it from the lan when connected at lan. Do you know a program, codes and how do it? TKS On Fri, 27 May 2005 13:17:17 -0300, Rudy <rudy@genesi.ws> wrote: > I have a pc IBM Netvista and I know that it's possible start it from the > lan when connected at lan. > Do you know a program, codes and how do it? > TKS you need a dhcp server, as well as nfs, i think that's it. should boot from net fine once you have that. -- Using Opera's revolutionary e-mail client: http://www.opera.co...

How to get a Maximal Image View in a Window?
*** post for FREE via your newsreader at post.newsfeed.com *** After I resized a (image) window how can I get the image maximized to fit the window? thanks Phuoc -- _/\__/\__/\__/\__/\__/\_ www.folksfun.com -----= Posted via Newsfeed.Com, Uncensored Usenet News =----- http://www.newsfeed.com - The #1 Newsgroup Service in the World! -----== 100,000 Groups! - 19 Servers! - Unlimited Download! =----- PC HUA <home-AT-huaonline.DOT.com> wrote: > *** post for FREE via your newsreader at post.newsfeed.com *** > > After I resized a (image) window how can I ...

How to get the function of the fitting surface?
Hi, all. I've some test data in three dimension. I can get the fitting surface by some function, e.g., the griddata function. I wanna to know whether MATLAB can get the function of the surface. If can, how to get it? Many thanks for your kind. bowlder. In article <41888f1d.47620859@news.cn99.com>, bowlder <bowlders@tom.com> wrote: > Hi, all. > I've some test data in three dimension. > I can get the fitting surface by some function, e.g., the griddata function. > I wanna to know whether MATLAB can get the function of the surface. > If can, how to get i...