Use the extract, replace, augment, and subcolor functions to extract or insert a single component matrix from a packed matrix comprising a color image, to pack three color components together, and to selected subsets of packed color matrices.
2. Extract the red component of the image using the extract function.
3. Convert the matrix to an RGB image by supplying zero values for the blue and green components.
(strike_red1.bmp)
replace
Manipulate and reassemble individual colors in an image.
1. Define a new variable that reduces the intensity of the red component in the sample image by half.
2. Apply the replace function to the image.
(strike_new.bmp)
The red component of image matrix M has been completely replaced by newred. You can replace any matrix, red (1), green (2), or blue (3) using this method.
augment and subcolor
Use the augment function to combine three matrices, for example representing red, green, and blue, into one color matrix. It can be used for RGB, HLS, HSV, YIQ, and YCbCr images.
Use the subcolor function to extract a subset color matrix (RGB, HLS, etc.) by taking the proper submatrix from each of the three color sections of the combined matrix.
1. Create an HSV image by combining separate H, S, and V parts using augment.
To view the wheel, we must first convert it from HSV to RGB.