How to read light intensity values on jpg image

8 views (last 30 days)
I'm working on a project on fluorescence thermography. I am a beginner for matlab and I am looking for the matlab steps and command to import and read the fluorescence intensity values on gray scale (not color) images captured (in .jpg). These values are requred to interpret the temperature values at various points.
Any help for detailed steps is appreciated! Thanks.

Accepted Answer

Ling Fang Toh
Ling Fang Toh on 3 Jan 2013
Hi, I have tried various commands but what I get are some integer which seems like rgb values to me. I'm trying to look for precise intensity values that is shown in about 3 decimal places. Also, is it possible to read the values by simply placing my cursor over the image?
  2 Comments
Image Analyst
Image Analyst on 3 Jan 2013
This is not an answer to your question is it? So it should have been an edit to your original question or a comment on Walter's question. To move the mouse around and see the pixel values, you need to use the command impixelinfo() in the Image Processing Toolbox.
Walter Roberson
Walter Roberson on 3 Jan 2013
It appears to me that the original JPEG file format did not support floating point values such as would be needed to have 3 decimal places. Either the data was scaled to 0-255 (or 0-65535) before it was written, or else you are using JPEG 2000.
To look at values by positioning with your cursor, go to the menu bar, and select Tools and from there, Data Cursor.

Sign in to comment.

More Answers (2)

Walter Roberson
Walter Roberson on 3 Jan 2013
FLreadings = imread('YourInputImageName.jpg');
if ndim(FLreadings) > 2
error('Try again with a grayscale image')
end
Then for any particular point row R column C, FLreadings(R,C) will be the intensity reading as stored in the image.
  3 Comments
Walter Roberson
Walter Roberson on 3 Jan 2013
JPEG does not itself do gamma correction: it just works on the exact values passed to the JPEG creation software, and reads back as close to those values as the lossy compression permits.
Jurgen
Jurgen on 3 Jan 2013
You are correct that it is not part of the JPEG algorithm. But we don't know what process generated the JPEG. Typical consumer software also does other things to make a picture presentable. Since they are "captured in jpeg" I can only assume it is not a custom scientific camera?

Sign in to comment.


Ling Fang Toh
Ling Fang Toh on 3 Jan 2013
I would also like to seek some explanation for this command imhist(I)... I am uncertain of the error message stating "to be two-dimensional".
>> imhist(I) ??? Error using ==> iptcheckinput Function IMHIST expected its first input, I or X, to be two-dimensional.
Error in ==> imhist>parse_inputs at 275 iptcheckinput(a, {'double','uint8','logical','uint16','int16','single'}, ...
Error in ==> imhist at 57 [a, n, isScaled, top, map] = parse_inputs(varargin{:});
  3 Comments
Walter Roberson
Walter Roberson on 3 Jan 2013
Your image is not grayscale then. It might be RGB in which all three planes are identical, and thus be a Truecolor image that happens to consist entirely of grays. Try
I2 = FLreadings(:,:,1);
imhist(I2)
Image Analyst
Image Analyst on 3 Jan 2013
I don't know why but it seems like everyone who comes here and asks about thermal images has the pseudocolored image, unfortunately. Probably because the native format is a vendor proprietary floating point format where each pixel is the actual temperature in degrees Celsius, and people don't have MATLAB code to read those proprietary formats (like I do) so they just save data out as an 8 bit grayscale or colored bitmap image. But then all or most of the true actual temperature information is lost. Even if you have the color map, the best you can get is the grayscale image, not the actual temperatures. You'd need additional calibration information on what temperature got assigned to what gray level.

Sign in to comment.

Categories

Find more on Agriculture in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!