Lab Assignment

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 9

Lab Assignment I

1. Take two images & perform arithmetic operations on them.

Coding:
i=imread('sunset.jpg'); j=imread('winter.jpg'); [m,n,p]=size(i); for x=1:m for y=1:n a(x,y)=i(x,y)+j(x,y); b(x,y)=i(x,y)-j(x,y); c(x,y)=i(x,y)*j(x,y); d(x,y)=i(x,y)/j(x,y); end end figure,imshow(i); title('First image'); figure,imshow(j); title('Second image'); figure,imshow(a); title('Image after addition'); figure,imshow(b); title('Image after substraction'); figure,imshow(c); title('Image after multiplication'); figure,imshow(d); title('Image after divide');

OUTPUT: Input Image 1:

Input Image 2:

Img hist

Given hist

Mslicing

Slicing2

Imdiv

Immul

Imsub

Imadd

Nneighbour

Originalpic

Bilinear

Bicubic

You might also like