Saturday, 17 March 2012

Lab 3 - Part 2

Image Acquisition and Basic Operation (MATLAB)

For this topic, the learning objective is to learn basic operations related to image acquisition.

1.      Read and display image
To read the image, use imread command, but make sure the image file is in a correct path (refer figure below, in the red rectangle).




2.      Convert image into grayscale
To convert color image into grayscale, use rgb2gray command.

                      


3.      Display image into green channel

                      



The above command and resulting image shows the intensity of green color in the original image data.

4.      Image transpose
To transpose the image A, use “ ‘ ” sign at the end of variable, example: A’





5.      Image cropping

                      


   

The imcrop command creates an interactive Crop Image tool associated with the image displayed in the current figure, called the target image. The Crop Image tool is a moveable, resizable rectangle that can be position interactively using the mouse. When the Crop Image tool is active, the pointer changes to cross hairs " + ", when moving it over the target image. Using the mouse, specify the crop rectangle by clicking and dragging the mouse. Use mouse to move or resize the crop rectangle. When finish sizing and positioning the crop rectangle, create the cropped image by double-clicking the left mouse button or by choosing Crop Image from the context menu. Use imshow command to display the crop image.

6.      Flip vertical
Use fliplr command to flip the image from left to right. However, it should be noted that fliplr command only work for 2-D matrices. 
                                  


 

0 comments: