Example: Using HLS and HSV Color Systems File Access Functions
Use HLS and HSV color systems related functions to read the below image.
dog.bmp
HLS Color System
1. Use READ_HUE to read the hue component of an image.
The hue component is common to both HLS and HSV color systems.
2. Use READ_LIGHT to read the light component of the image, as a part of the HLS color system.
3. Use READ_HLS_SAT to read the saturation component of the image, as a part of the HLS color system.
4. Read the image using READ_HLS.
M1 is a packed image matrix.
5. Join the hue, light and hls_sat matrices to a single matrix and compare it to M1.
The two matrices are identical.
6. Write out M2 to a graphic file.
HSV Color System
1. Use READ_VALUE to read the value component of an image, as a part of the HSV color system.
2. Use READ_HSV_SAT to read the saturation component of the image, as a part of the HSV color system.
3. Read the image using READ_HSV.
M3 is a packed image matrix.
4. Join the hue, hsv_sat and value matrices to a single matrix and compare it to M3.
The two matrices are identical.
5. Write out M4 to a graphic file.
Comparing the Results
Read the two images and compare them.
Although you used two color systems, the two images are identical.