2. Apply the blend function to the two images. The images must be of the same size.
(fruit_lena.bmp)
3. 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: