Professional Documents
Culture Documents
THEORY:
Unary operation can be any mathematical function that changes the intensity values of the pixels in an
image. Co-domain of the function does not have to be equal to its domain. Therefore, if we want to
obtain a meaningful display of an image after performing an unary operation on it, the resulting image
will need to be rescaled. Images whose pixel values are given with a class double should be scaled to the
interval [0;1], whereas the images whose pixel values are given with a class integer should be scaled to
the interval [1;255]. MATLAB function imagesc() does an automatic scaling to the required interval and
displays it.
An example:
Tasks:
1. Compare the function imagesc with the functions image and imshow
2. Read the image. Create a grayscale image out of that image (function rgb2gray()). Perform the
following unary operations on that image: logarithmic function, square and square root, and
compare what happened to the different parts of the image.
Binary options require the input images sizes to be equal. The options for this are following: To decrease
the size of the bigger image, to increase the size of the smaller image, or to change the size of the both
images. Also, the colorspace of both images needs to be the same (RGB, HSV or other; or black and
white), ie. both images need to be indexed and have the same color palette.
An example:
Tasks:
1. Pick two grayscale images with different sizes from the USC-SIPI image database. Try several
binary operations on them: summation, multiplication, subtraction. Display the results and
explain them.
2. Try the same thing in the RGB images. Display the results. Explain what happened.
5
The most common binary operation in the practice is the subtraction of the images. It is used with a
purpose of emphasizing the contrast. In this type of applications, one of the images usually contains a
regular scene (the background), while the other one contains an objects (or more of them) which we
want to emphasize, positioned in front of the same background. Assuming that the background didn’t
change, the subtraction of the images results in a new images whose pixel values are the largest exactly
in the places where our objects of interest are positioned.
Conclusion: