person.jpg
and empty_room.jpg
to your
working directory.
Write a simple Matlab showimage.m
script that performs
the following simple experiment.
mean
or sum
.
image, imagesc,
imshow
.
Do all displaying functions work? Discuss the results? What is the reason for different behavior? Write your analysis to your script in form of comments.
Grading: [1 point(s)] for correct analysis
Write a Matlab funtion compareim.m
that compares
two images and returns binary image with "1" in those pixels where the
difference will be grater than a specified threshold. If
im1,im2
are color images return "1" in positions where
any of the color channel differences is grater than a threshold.
Specifications: [binim,maskedim]=compareim(im1,im2,thr)
im1,im2
input images
thr
threshold
binim
binary image according to specification above
maskedim
masked im2
. All pixels that similar to im1
will be zeroed, will be black. Only the different pixels will be shown.
The function should be robust. It should correctly handle incompatible
input parameters, for instance if im1
and
im2
have different number of pixels. See the Matlab
function error
.
Grading: [3 point(s)] for a complete functionality if im1,im2
are grayscale images. 4 points for complete functionality on color images.
General comments. The programming style will also be evaluated. All your scripts and comments shuold be properly commented.
Pack your working directory with all images, codes and upload to the upload_system .