Basics of Image Processing through Matlab  

Posted by shashank

April 16, 2009
- Open image using imread command.
- Show image using imshow command.
- Save image using imwrite command.
- See image's histogram using imhist command.
- There are 4 types of images in

  • Black and White - Binary images, 1 for white, 0 for black.
  • Grey scale Images - Intensity images, 0 to 255 range.
  • Colored Images - RGB images, further divided into 2 types:
1. RGB image - In RGB there exist 3 indexed images. The first consists of all the red portions. The second the green portions and the third the blue portions.
2. Indexed Image - It is composed of 2 matrices - the image matrix and the map matrix. Each color in the image is given an index number and in the image matrix each color is represented using an index number. The Map Matrix contains the database as to which index number belongs to which color.

-------------------------------------------------------------------------------------------
Source: http://amath.colorado.edu/courses/4720/2000Spr/Labs/Worksheets/Matlab_tutorial/matlabimpr.html
Image format conversion
(Within the parenthesis you type the name of the image you wish to convert.)
Operation: Matlab command:
Convert between intensity/indexed/RGB format to binary format. dither()
Convert between intensity format to indexed format. gray2ind()
Convert between indexed format to intensity format. ind2gray()
Convert between indexed format to RGB format. ind2rgb()
Convert a regular matrix to intensity format by scaling. mat2gray()
Convert between RGB format to intensity format. rgb2gray()
Convert between RGB format to indexed format. rgb2ind()


How to convert between double and uint8

When you store an image, you should store it as a uint8 image since this requires far less memory than double. When you are processing an image (that is performing mathematical operations on an image) you should convert it into a double. Converting back and forth between these classes is easy.

I=im2double(I);

converts an image named I from uint8 to double.

I=im2uint8(I);

converts an image named I from double to uint8.


-------------------------------------------------------------------------------------------

This entry was posted on Monday, April 20, 2009 at 3:06 PM . You can follow any responses to this entry through the comments feed .

0 comments

Post a Comment