Chanleangchhung Midterm
Chanleangchhung Midterm
ID : B20190184
Group : Co4E1
Midterm Exam
Answer
I.
II. Y=imresize(X,0.5,’nearest’);
Z=imresize(Y,2.0,’nearest’);
No, X and Z will not necessarily be identical. Because the code resizes the gray-
level image X to half its original size using nearest-neighbor interpolation and
stores the result in Y. Then, Y is resized back to its original size using nearest-
neighbor interpolation and stored in Z.
Therefore, the result of the resizing operation on Y may introduce or remove
some details that were present in the original image X. When Y is resized back to
its original size, these changes may be amplified, resulting in a final image Z that
is not identical to X.
III. Imcomplement (IM) computes the complement of the image IM. IM can be a
binary, intensity, or RGB image. IM2 has the same class and size as IM. In the
complement of a binary image, zeros become ones and ones become zeros;
black and white are reversed.
• imadjust(I) maps the intensity values in grayscale image I to new values
in J. By default, imadjust saturates the bottom 1% and the top 1% of all
pixel values. This operation increases the contrast of the output image J.
IV. M-file script that rotates an image by 60 degrees counterclockwise using the imrotate
function, and then applies the imadjust function to adjust the contrast of the rotated
image.
V.