image

2 views (last 30 days)
Krishnendu Mukherjee
Krishnendu Mukherjee on 12 Mar 2012
im very new in image processing. in matlab how an image is represented? when i use imread() command lots of number comes what are they? is there any way to get pixel of a particular co-ordinate. what is colormap? actually i need some tutorial in image processing in matlab7
  1 Comment
Krishnendu Mukherjee
Krishnendu Mukherjee on 13 Mar 2012
everybody's answer help me a lot.
hopefully i will complete the assignment very soon.and will upload it also.
everybody helps me.each answer was helpful to me in this regurd.
sao,i could nt decide which answer to accept,better i accept each answer from heart

Sign in to comment.

Answers (3)

Bjorn Gustavsson
Bjorn Gustavsson on 12 Mar 2012
Simplest and quickest start you get by typing:
demo
at the matlab prompt, then browse your way to the image processing toolbox.
HTH

Matt Kindig
Matt Kindig on 12 Mar 2012
Hi Krishendu,
Suppose you call imread as follows
A = imread('/filename.jpg')
The resulting matrix A will be MxNxP, which represents the pixel values that make up the image. For RGB (truecolor) images, P=3 and the returned matrices contain the red, green, and blue components of the pixel values. The matrix values will vary between 0 and 255. Thus to find the pixel value at, say, row 100 and column 50, call as
red = A(100,50,1)
green = A(100,50,2)
blue = A(100,50,3)
If the image is an indexed image (e.g. a lot of medical images use indexed images), P=1 and the matrix values will vary from 0 to some other number. This indicates the position of the pixel in a colormap, which is an Mx3 matrix of color triplets (red,green,blue sets). Thus, if you have a 100x3 colormap 'Map' and your pixel value is A(i,j) = 10, the pixel has the color corresponding to the 10th row in Map. More information on colormaps can be found in the documentation for colormap.
If you have the Image Processing Toolbox available, I would recommend looking at the Getting Started section in the Help for that toolbox. The demos are also worthwhile. What kind of image processing are you trying to do?
  4 Comments
Matt Kindig
Matt Kindig on 13 Mar 2012
It's not really clear what you are trying to do. Can you post an image online of the speedometer, and like to it for us?
Krishnendu Mukherjee
Krishnendu Mukherjee on 13 Mar 2012
thanks to you also.

Sign in to comment.


Image Analyst
Image Analyst on 12 Mar 2012
Lots of numbers come up if you don't put the semicolon after imread() - it's that way with all MATLAB functions. They'll echo the results to the command window unless you end the line with a semicolor to suppress that.
A colormap maps a gray level into an RGB color. For example you could map black (0) into blue (0, 0, 255), or white into red (255,0,0), or some mid gray value (say, 128) into yellow (255, 255, 0).
You might look over my image processing tutorials, particularly BlobsDemo. http://www.mathworks.com/matlabcentral/fileexchange/?term=authorid%3A31862
  3 Comments
Krishnendu Mukherjee
Krishnendu Mukherjee on 13 Mar 2012
one more thing thats if i want to map red replacing white,bt in a specific region like from coloum 70to100 and row 10 20.is this possible
Image Analyst
Image Analyst on 13 Mar 2012
Yes, but you'll have to convert to a true color image. If you have a grayscale (indexed) image with a colormap, then that colormap applies to all pixels with that gray level, wherever they may be in the image. If you want pixels with that white gray level to become red in ONLY certain rectangles of the image and not the rest of the image, then you'll have to make it be an RGB image. See ind2rgb().

Sign in to comment.

Categories

Find more on Images in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!