Industrial Vision Lab 2: Digital Image Formation
Industrial Vision Lab 2: Digital Image Formation
1. Generate the following binary images of size 256256 and display the results:
Note: The images must be defined using the logical data type.
2. Generate the following gray scale images of size 256256 and display the results:
Note: The images must be defined using the uint8 data type.
3. Generate the following RGB images of size 256256 and display the results:
Note: The images must be defined using the uint8 data type.
4. Write a function in Matlab to generate the histogram of a gray scale image without using Matlab functions.
The signature of the function must be:
f u n c t i o n h = h i s t o g r a m ( image )
where h is a column vector with 256 elements of type double and image is the input gray scale image. Each
component of h indicates the number of pixels of the correspondent intensity present in the image.
1
5. Using the function implemented in the previous point, compute the histogram of the images of the exercise
2, and plot the results. Are the histograms the same?
6. Resize the images generated in exercise 2 to 512512, 128128 and 6464 using the correspondent Matlab
function. Plot each resulting image and its correspondent histogram in figures. Given these histograms, how
can we say about the resizing process in Matlab?
7. Write a function in Matlab to reduce images of size 256 256 to 128 128. The intensity value in the output
image should be the maximum intensity in a neighborhood of the input image according to the following
pattern:
where image is the input image (256 256) and himage is the output image (128128).
8. Use the function implemented in the previous point to reduce images generated in exercise 2 and display the
results.