Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

HSL Vs. RGB Color models for color-Matching function

When using color matching functions in Vision 6.0 for VB, do I need to set my image types to HSL32 instead of RGB32, or do the functions do this internally? I need to do some color comparisons between some simialar colors, and I know hue is more accurate then RGB.
0 Kudos
Message 1 of 2
(5,032 Views)
Hello cdave,

This is a great question.

The quick answer to your question is HSL32.

The explaination is the following:
If using the IMAQ 1411, the NTSC or PAL color signal can be digitized into HSL or RGB (selectable in the Channel Properties in MAX).
- RGB is ideal if you want to display the live color images, because RGB is used by the video driver for updating your monitor.
- HSL is ideal for processing your image. Hue represents all the color information in a single 8-bit plane, so it is ideal for color matching applications. Luminence represents all the black & white information, so it is ideal for most other image processing algorithms. If displaying HSL (in MAX), the image might look distorted or psychotic.
- Both RGB and HSL conversions are done on
the 1411, and it removes the CPU requirement from the Host Computer.

After the image is acquired (in either image type), then in software you will define the image type you want the software program to process the image.
- If RGB is selected in MAX (from above) and RGB is selected in your program, then it will be a fast operation. Same thing for HSL.
- If HSL is selected in MAX, and RGB is selected in your program, then the program will be slower because it will have to convert the image into the correct image format.

If using color matching, if HSL is selected in both MAX and for your image type, then the code will be optomized.
- If RGB is selected, then the program will convert the image before performing the color matching on it.

If you have any other questions, please let me know.

Alan Hagler
National Instruments
Message 2 of 2
(5,032 Views)