Professional Documents
Culture Documents
Homework 1 Solution
Homework 1 Solution
Homework 1
X = imread(‘peppers.png’);
4) Save X as “New_image.png”
imwrite(X, “New_image.png’);
New_image_gray = rgb2gray(X);
uint8
I=New_image_gray;
[M, N]=size(I);
oo=zeros(M,N);
for i = 1: M
for j=1:N
end;
end;
imshow(oo);
10) Write a program to generate the negative of New_image_gray and display New_image_gray and
its negative side-by-side.