You are on page 1of 4

IMAGE PROCESSING

To read the image :


Type imread(‘address of the image\name of the image.format
of the image’)
a=imread('C:\Users\Anhishek\Desktop\bird.jpg');
To show the image:

imshow(a);
To show the image and different tool operations in image:

imtool(a);
To crop the image :

imcrop(a,[253 202 810-253 664-202]);


initial(x) initial(y) final(x)-initial(x) final(y)-initial(y)
 To resize the image:
Type imresize (variable at which you read the image in
program, the factor by which you want);
Example: a(variable)=imresize(c,0.5);
imshow(a);----{for showing the image}
 To rotate the image at an angle:

Type imrotate (variable at which you read the image in


program, the angle by which you want);
Example:
z=imrotate(a,75);
imshow(z);
 To show all the plot at a time:

subplot(2,2,1), imshow(a);subplot(2,2,2),imshow(b);
subplot(2,2,3),imshow(c); subplot(2,2,4),imshow(d);
 To know the size of the image:
Type size(variable in which your image is stored).
Ex- size(a)
 To know the information about the image:
Type imfinfo(‘address of the images')
Ex- imfinfo('C:\Users\Anhishek\Desktop\bird.jpg')
 To see the pixel information by moving the cursor:
write only impixelinfo then press enter key.
 To delete the row by pixel number:
Ex- a(800:900,:)=0;
imshow(a)
 To see the three layer of the images on a sub plot :
 Program-
e=imread('C:\Users\Anhishek\Desktop\bird.jpg');
>> imshow(e);
q=e(:,:,1);
>> subplot(2,2,1);imshow(q);
>> w=e(:,:,2);
>> subplot(2,2,2);imshow(w);
>> a=e(:,:,3);
>> subplot(2,2,3);imshow(a);
>> q=e(:,:,1);

You might also like