Real-Time Color Space Conversion for [D1] Video
Red-Green-Blue to Intensity-Hue-Saturation using FPGAs
Fourth generation FPGAs are powerful enough to implement multiple 8-bit parallel multipliers or dividers. In particular the following RGB to IHS transform:
I{ntensity} = max (red,green,blue)
S{aturation} = (I - min(r,g,b)) / I
H{ue} ~ ( mid(r,g,b) - min(r,g,b) ) / ( max(r,g,b) - min(r,g,b) )
can be implemented in a single device and used for real-time video processing (13.5 MHz D1 Video).
Syngraphica Inc. implemented an RGB <-> IHS module using FPGA's as part of its Digital Video Lab (TM) - a real-time D1 video / digital image processing / video effects generator backbone. The Digital Video Lab [ DVL ] uses a 3U { ~~ 4"x6" } form factor and so space is at a premium. Further, it processes 24-bit per pixel video (three 8-bit sub-channels) at real-time video rates (13.5 MHz). Until recently only special purpose image processing ICs such as monolithic 3x3 convolvers with built in row buffers (e.g., Harris's HSP48908) would be useful in such an environement; but with the advent of 100k+ gate FPGAs it is now possible to build general purpose modules of high utility whose function can be altered simply by reprogramming. In fact with the module in question not only do we do RGB <-> ISH color space conversion but also 1-D edge detection.
The RGB color-space is in some ways the native color space and is necessary for communicating to a color monitor. It is also an optimal color space for such color image processing applications as bilinear interpolation. On the other hand, color correction / substitution is best done in an IHS type space. Also, it is often possible to do all of the necessary image processing on the intensity channel and leave the chroma {hue, saturation} channel untouched.
Various application notes from various IC manufactures suggest that by using their 3x3 multipliers one can convert from RGB to IHS and back again. And they are absolutely correct if you are willing to convert the RGB to YUV with their device and then use four external 1/2 megabit look-up-tables [LUTs] plus an 8-bit adder to finish the conversion to IHS. {Of course that leaves open the question of going from IHS to RGB}.
There is also a chip-set available that converts RGB <-> IHS but it implements a non-optimal definition of hue; and their definitions of intensity and saturation result in the posibility of having illegal combinations of same - a state acceptable for some applications but not others. (Unfortunately, for those of us who would just prefer to buy a merchant part, the more the image is is processed the more likely it is that illegal combinations will occur in color spaces that do have illegal combinations.)