Tuesday, 13 March 2012

IMAGE ACQUISITION AND BASIC OPERATION(MATLAB)

IMAGE PROCESSING TOOLBOX


In this lab, we have performed some basic image processing exercise by matlab. The main purpose of this lab is to :
1.       Read and display image
2.       Check how the image appears in the workspace
3.       Perform histogram equalization on the image
4.       Write the image to a disk file
5.       Get information about graphic file



Below is the commands and example output:

>>I = imread (‘pout2.png’)     % Output the array

>>Imshow(I)                          % To display image

Original   'pout2.png'



>>whos    % To see how I is stored in memory
Input and output of 'whos' command



>>figure, imhist(I)    % To display histogram of I in the new figure

Histogram equilization




>>I2 = histeq(I)      %Equalize I and output in new array

>>figure, imshow(I2)    %Display the new equalized image I2.




Equilized   'pout2.png'



>>imwrite(I2, 'pout2.png')      % To write the newly adjusted image I2 back to disk.

>>imfinfo(‘pout2.png’)     % To check the content of newly written file

Check info







Next, we also learn on how to edit image
This command shows original image

>> x = imread ('obama.png');
>> figure,  imshow (x)

The original image


This command functions to convert original image to be gray scaled:
>> x_g = rgb2gray(x);
>> figure, imshow (x_g)


The image has been converted to gray scale


This command allow cropping image:-
>> imshow (x_g' imcrop);



This command function will flip the image:

>> figure(1); image(x)
x(:, :, 1) = fliplr (x(:, :, 1));
x(:, :, 2) = fliplr (x(:, :, 2)); 
x(:, :, 3) = fliplr (x(:, :, 3)); 
figure(2); image(x)


The flipped image


Commands function below will show how an image being flipped vertically and horizontally

>> xMirror = flipdim(x,2);             % horizontal flip
>>  xUpsideDown = flipdim(x,1);  % vertical flip
>> xHorizontalAndVerticalFlip = flipdim (xUpsideDown, 2);  % horizontal and vertical flip

>> subplot(2,2,1), imshow(x)
>> subplot(2,2,2), imshow(xMirror)
>> subplot(2,2,3), imshow(xUpsideDown)
>> subplot(2,2,4), imshow(xHorizontalAndVerticalFlip)

Flipped image in both vertical and horizontal









Image info by using command function >> iminfo(x)



Monday, 5 March 2012

LAB MODULE 2.

There are three (3) basic objects in matlab which are scalar, vector and matrices. Below is an example for each object:

Scalar
a = 5
there is only a value presents in scalar object.

Vector
v = [1 5 6]
vector usually displayed in matrices form


In MATLAB, there are some  commands to allow matrice operation to be formulated.

Some of the commands are:

1) When create a matrice




2) To determine the coordinate of matrice





3) Below are the examples to calculate the value of summation, mean, maximum, and minimum values of a matrix MatrixBITI









4) Below are examples to write the location of the pixel 4 and 10 in the matrix Exe











Tuesday, 28 February 2012

LAB MODULE 1.

In our first lab, we have been exposed about image processing and pattern recognition basis. Dr. Hidayah explained about features which is an attribute in image processing. Based on our understanding, image processing is the process of defining input image into specific output. Maria Petrou in her book, Image Processing: The Fundamentals, image processing nowadays refers mainly to the processing of digital images.

source: google image

Then, we have to solve a task in details which  questioned about:

  • How camera works.
  • Camera vs eyes.

That task have been submitted to petunjuk76@gmail.com.

Thank you.

INTRODUCTION.

Assalamualaikum and Salam 1 Malaysia. First of all, we would like to thanks to our beloved lecturer, Dr. Hidayah binti Rahmalan who gave us an opportunity to create this blog. The main purpose of this blog is to fullfil the lab requirement for 'Image Processing and Pattern Recognition' subject. 

This blog will be monitored by our group members who are:

1. Nurbalqis binti Yusoff                  B030910016       3 BITI
2. Raihan binti Mohamed Isa           B030910158       3 BITI


Thank you.
Related Posts Plugin for WordPress, Blogger...