1 (1)fgvjask

11
1.0 TITLE : Introduction to Digital Image Processing Using MATLAB 2.0 OBJECTIVE : 1. Use the basic MATLAB function for handling digital image. 2. Understand the concept of bit plane in storing image data. 3. Understand basic concept of digital image processing by using filtering and edge technique in MATLAB. 4. Present a given task findings in the form of standard technical report. 5. Work effectively in given task as individual or in group. 3.0 EQUIPMENT : Software : MATLAB 4.0 RESULT :

Transcript of 1 (1)fgvjask

Page 1: 1 (1)fgvjask

1.0 TITLE : Introduction to Digital Image Processing Using MATLAB

2.0 OBJECTIVE :

1. Use the basic MATLAB function for handling digital image.

2. Understand the concept of bit plane in storing image data.3. Understand basic concept of digital image processing by using

filtering and edge technique in MATLAB.4. Present a given task findings in the form of standard technical report.

5. Work effectively in given task as individual or in group.

3.0 EQUIPMENT :

Software : MATLAB

4.0 RESULT :

Page 2: 1 (1)fgvjask

RESULT

PART 1

I=imread ('doraemon.jpg');Y=rgb2gray(I);figure;subplot (121);imshow (I);title('original')subplot (122);imshow(Y);title('grayscale');

I=imread ('doraemon.jpg');Y=im2bw(I);figure;subplot (121);imshow (I);

Page 3: 1 (1)fgvjask

title('original')subplot (122);imshow(Y);title('monochrome');

%Display Originalfigure(1);subplot(221);imshow(scene)title('Original'); %Display red channelscene_red=scene; scene_red(:,:,2)=0; scene_red(:,:,3)=0;subplot(222);imshow(scene_red);title('Red Channel'); %Display green channelscene_green=scene; scene_green(:,:,1)=0; scene_green(:,:,3)=0;subplot(223);imshow(scene_green);title('Green Channel'); %Display blue channelscene_blue=scene; scene_blue(:,:,1)=0; scene_blue(:,:,2)=0;subplot(224);imshow(scene_blue);title('Blue Channel');

Page 4: 1 (1)fgvjask

PART 2

%Original ImageI=imread ('doraemon.jpg');figure;subplot (221);imshow (I);title('original') %First technique = rotate image at certain degrees in counter clockwiseY1=imrotate(I,90);subplot (222);imshow(Y1);title('Rotate 90degree'); %Second technique = Flip matrix (image) along specified dimensioneY2=flipdim(I,1);subplot (223);imshow(Y2);title('Flip Dimension'); %Third technique = Flip matrix (image) along specified dimensioneI=imread ('doraemon.jpg');Y3=imadd(I,100);subplot (224);imshow(Y3);title('Brightness control');

Page 5: 1 (1)fgvjask

PART 3

I=imread ('doraemon.jpg');Y=rgb2gray(I);Img_Noise=imnoise(Y,'salt & pepper', 0.5);figure;subplot (121);imshow (I);title('original')subplot (122);imshow(Img_Noise);title('Grayscale with noise');

Page 6: 1 (1)fgvjask

I=imread ('doraemon.jpg');Y=rgb2gray(I);%NoiseImg_Noise=imnoise(Y,'salt & pepper', 0.5);%Gaussian BlurringG = fspecial('gaussian',5,0.7);%Motion BlurringM= fspecial('motion',5,45);%FilterH=imfilter(Y,G);figure;subplot (321);imshow (I);title('original')subplot (322);imshow(Img_Noise);title('Grayscale with noise');subplot (323);imshow (G);title('Gaussian Blurring');subplot (324);imshow(H);title('Gaussian Filtering');subplot (325);imshow(M);title('Motion Blurring');

Page 7: 1 (1)fgvjask

5.0 DISCUSSION

Image processing involves changing the nature of an image in order to either improve its

pictorial information for human interpretation, or render it more suitable for autonomous

machine perception.

With digital image processing, which involves using a computer to change the

nature of a digital image .It is necessary to realize that these two aspects represent two

separate but equally important aspects of image processing.

An image is loaded into working memory using the command

>> I = imread(‘image file name’);

The image can be displayed using

>> imshow(I),I is the image to be displayed.

The semicolon at the end of the command suppresses MATLAB output. Without it,

MATLAB will execute the command and echo the results to the screen.Assign the image

Page 8: 1 (1)fgvjask

to the array I. If no path is specified, MATLAB will look for the image file in the current

directory.

For Part 1, An image may be considered as consisting of a stack of three matrices;

representing the red, green and blue values for each pixel. This means that for every pixel

there correspond three values. RGB is the standard for the display of colours on computer

monitors or on TV sets. But it is not a very good way of describing colours.

For grayscale, each pixel is a shade of grey, normally from (black) to (white). This

range means that each pixel can be represented by eight bits, or exactly one byte. This is

a very natural range for image handling. Other greyscale ranges are used, but generally

they area are in power of 2. Bitplane is sometimes used as synonymous to Bitmap;

however, technically the former refers to the location of the data in memory and the latter

to the data itself.

Know that basic color coding is (:,:,1) represent red channel, (:,:,2) represents green

channel and (:,:,3) represents blue channel. So, to display the red channel, set the green

and blue channel to 0 and vice versa. Miscoding command will result the reverse process

or system will fail to show the desired images.

In part 2, the basic technique to manipulate the digital image using MATLAB had been

tested. Different technique will result different ways of producing an image. In advanced,

there are many technique in generating an attractive image such as overlay the image,

changes the brightness or by using the arithmetic operation on the image. Therefore,

combining any technique as shown in figure 4, part 2 will produce an interesting image.

For Part 3, Removing noise from an image as the noise being random errors in the image.

A Gaussian blur also known as Gaussian smoothing is the result of blurring an image by

a Gaussian function. It is a widely used effect in graphics software, typically to reduce

image noise and reduce detail. The visual effect of this blurring technique is a smooth

blur resembling that of viewing the image through a translucent screen, distinctly

Page 9: 1 (1)fgvjask

different from the effect produced by an out-of-focus lens or the shadow of an object

under usual illumination.

While, motion blur is the apparent streaking of rapidly moving objects in a still image or

a sequence of images such as a movie or animation. It results when the image being

recorded changes during the recording of a single frame, either due to rapid movement or

long exposure. Motion blur may occur when the shutter speed of the camera is too long

for the speed of the object. In photographing of fast moving objects, athletes and

vehicles, the technique of blur maybe considerable.

6.0 CONCLUSION

As the conclusion.by exploring the basic digital image processing, image manipulating and certain technique in image filtering using Matlab student are able to generate their own images. The concept of bit plane in storing image data also been understood.