Write one program to generate these three test images. (1) Vertical Mach Bands: Create a 512 x 512 image that conatins eight vertical bands. Each band should have the same width and uniform intensity. The bands should increase linearly in brightness from left to right. (2) Horizontal Mach Bands: Transpose the image of the vertical Mach bands to get an image with horizontal Mach bands, with the darkest band on the top and the brightest band on the bottom. (3) Boxes: Create a 512 x 1024 image containing four squares. The two 512 x 512 "outer squares" represet two different surround intensities L1 and L2. The two 64 x 64" inner squares, each centered inside an outer square represent the background intensities B1 and B2.
Image A: Vertical Mach Bands |
Image B: Horizontal Mach Bands |
Image C: Boxes |
|---|---|---|
![]() |
![]() |
![]() |
Using the Boxes image, try the following: Let B1 = B2 = X, where X is any value. This sets both inner squares to the same intensity value. Fix L1 at any value sufficiently different from X (where you can percieve a difference between them. Vary L2. This demonstrates the effects of simultaneous contrast. Tray all combinations of intensities 0, 128 and 255 for X and L1 for a total of 6 combinations. For each combination, try several values of L2.
Write functions that apply the following transformations to an image.
s(r) = T(r) = A*sqrt(r) with A = 0.7
![]() |
![]() |
|---|
s(r) = T(r) = L-1 for r >= L/2 and s(r) = T(r) = 0 for r < L/2
![]() |
![]() |
|---|
Write a MATLAB function to equalize the histogram of an image. Apply this to the Bank video image and plot the equalized histogram.
![]() |
![]() |
|---|---|
![]() |
![]() |
Investigate the effect of an inverse gamma correction point operation given by the equation (see assignment handout) on a perfectly normal image. The point operation produces an image which must be gamma corrected to restore it's original contrast. Use this transformation on the Lena image. Use your histogram equalization code on the gamma corrected Lena image.
![]() |
![]() |
![]() |
|---|---|---|
![]() |
![]() |
![]() |
Use your histogram equalization code on a Boxes image with background intensities B1 = B2 = 255 and foreground intensities L1 = L2 = 254.
![]() | ![]() |
|---|---|
![]() |
![]() |
My histogram equalization algorithm (see equal.m) was not robust enough to handle the equalization of Boxes image with L1 = L2 = 254 and B1 = B2 = X = 255. I used the built-in MATLAB histogram equalization function histeq instead.
Write a program that reads in two images of the same size and hides one image in the lower bit-planes of the other. Write and inverse function that extracts and displays the hidden image. Test your program by hiding the image of Barbara in the image of Lena.
![]() |
![]() |
![]() |
embed.m |
|---|
![]() |
recover.m |
|---|
The recovered image of Barbara is imperfect due to distortion of the bit planes during jpeg compression of the embedded image as it is output from MATLAB.