DSPRelated.com
Forums

Image Types in Matlab

Started by Nina May 25, 2006
Hi,

I have no experinece in either image processing or matlab.  I am a
little confused about image types and image processing toolbox in
matlab, and i appreciate if anyone could please clarify these
confusions.  So here is my problem:
According to image processing tool box users's guide, an intensity
image is stored in a single 'intensity matrix' that contains double
precision values ranging from 0.0 to 1.0.
My images are just raw data output of a light microscope.  They are 16
bit data.  So each 2 bytes corresponds to a value of a single pixel or
a gray level.  The gray level values for my images range from around
150 to around 300 (and with the CCD that i use 4096 graylevel values
are possible). And the size of each image is 256x256.
Now, since my image files are raw data, i cannot read them with imread
function of the image processing tool box.  I just read them using
commands like:
fid =fopen('012706_12.001', 'r', 'l'); //012706_12.001 is the name of
the image file here
status = fseek(fid, 512, 'bof');
A = fread(fid, [256 256], 'uint16');
Here is my confusion: so since the gray scale values of my images
(elements of matrix A in the above example) are not between 0.0 and
1.0, matlab does not recognize this as an intensity matrix and as a
result an intensity image.  Is this correct?
And so do i need to use mat2gray function to rescale my data to 0.0,
and 1.0? But is there any other way that i keep my grayscale levels the
way they are (and not rescale them to 0.0 and 1.0) and still be able to
use the image processing tool box?

Sorry for the long description.
I hope it makes sense.

Thank you,

Regards,

Nina