1. Use the READ_IMAGE function to read in two 256 x 256 grayscale images.
(fruit.bmp)
(lena.bmp)
2. Apply the blend function to the two images. The images must be of the same size.
3. Use the WRITEBMP function to write the blended image to a file.
(fruit_lena.bmp)
4. Define two equally-sized matrices Q and R, and apply the function to view the result of blend mathematically.
The blend matrix is constructed using the following formula:
When an element of either M or N is 255, blend returns 255 (the desired clipping response). When M or N is zero, blend returns only the remaining element.
mask
Use the mask function to black out a part of an image so that the remaining features can be processed individually.
1. Read in and display a brain image.
(brain.bmp)
2. Read in a mask image.
(mask.bmp)
3. Count the rows and columns in the two matrices:
The head image has one more row than the brain mask matrix. Use the submatrix function to extract the first 256 rows: