# How to Use the Walsh Hadamard Transform to Filter 24 bit RGB Color Values in a Localized Spatial Region?

After reading this Signal processing Stack Exchange article tonight, What is the Walsh-Hadamard Transform and what is it good for?, I became interested in applying the Walsh-Hadamard transform to filter one of three classes of 24 bit RGB color values, True Blue or True Green or Tree Red, in a localized spatial region of the color image seen from a commercial airplane cockpit.

In the book Color Image Processing and Applications, the authors Konstantinos Plataniotis, Anastasios N. Venetsanopoulos state that the RGB space is not sn efficient representation for compression because there is a significant correlation between the three color components since the image energy is distributed equally among them both spatially and spectrally.

A solution is to apply an orthogonal decomposition of the RGB color signals in order to compact the color image data into fewer channels. The commonly used YIQ, YUV and YCBCR color spaces are examples of color spaces based on these principles. The resulting luminance chrominance decomposition exhibits unequal energy distribution from the luminance component in which the vast majority of fine detail high frequencies can be found

I would like to apply color image YUV or YUV (or YCbCrYCbCr which is like HSV) compression to theoretically attain almost real time filtering of RGB color coordinates in a localized spatial region of the color image seen from a commercial airplane cockpit. The reason for the spatial localization is that we do not want to subtract green from everwhere uniformly in the color image projected to the commercial airliner flight team.

Please consider the paper, NTSC component separation via Hadamard transform, Published in: Vision, Image and Signal Processing, IEE Proceedings - (Volume:141 , Issue: 1 ) Feb. 1994 page 27-32 where the authors, M. Coley and J.Barba of the New York Institute of Technology present a technique for separating the NTSC composite signal into its components (Y, I, Q) by applying an N×N Hadamard transform directly to the composite signal sampled at four times the colour subcarrier. They show that the Y, I, Q component signals are mapped into specific areas in the Hadamard domain. Component separation is achieved by assigning particular transform coefficients to each component signal. Simulation results of component separation applied to five colour images and one black and white test pattern are presented. Both signal to noise ratios and subjective results are presented. The results indicate that no noticeable degradation is expected in typical colour images.

I am interested in restricting RGB color filtering to small localized spatial regions of the color image acquired by per pixel processing of an array of sensors developed by either by M.I.T Lincoln Labs [27] Kelly, M. W. and Blackwell, M. H., “Digital-pixel FPAs enhance infrared imaging capabilities,” Laser Focus World 49(1), 90 (2013). or Stanford University's DEpartment of Electrical Engineering and Computer Science, [28] Wan, G., Li, X., Agranov, G., Levoy, M., and Horowitz, M., “CMOS Image Sensors With Multi-Bucket Pixels for Computational Photography,” IEEE J. Solid State Circuits 47(4), 1031–1042 (2012).

Thank you.

• Saturation is how pure the color is from spectral point of view. For example, a laser has a very narrow spectrum, which implies high saturation.If a laser has high saturation, is the converse true? In other words , If I measure RGB and convert to HSV, does high saturation imply that it must originate from a coherent laser source? Thank you. – Frank Feb 14 '16 at 9:39
• Moore's Law says that GPU math processing speeds will continue to grow significantly today and the future as transistor densities on VLSI and VHSIC chips increase. Does that mean we do not do the Hadamard product and inverse steps in the future? – Frank Feb 14 '16 at 9:57
• could you review my answer? – Royi Jan 17 at 12:45

## 1 Answer

The JPEG-XR Standard is using the Walsh Hadamard transform (Instead of DCT / Wavelets).

It has pretty good results (Unfortunately, it didn't get enough traction, yet it is supported on Windows).

You can follow the standard and have idea how to use it for image compression.
You'll be able to even get some source code.

• Thank you for your answer. How could we apply the Walsh-Hadamard transform to attain almost real time filtering of RGB color coordinates in a localized spatial region of the color image seen from a commercial airplane cockpit? In addition, since laser light is coherent, perhaps how could we image and detect the self-interference / "laser speckle" pattern that would show up when the laser strikes a diffuse material, which is generally not present in an incoherent background en.wikipedia.org/wiki/Speckle_pattern? Thank you. – Frank Apr 1 '16 at 20:33
• @LaurentDuval, I didn't mention JPEG2000. I mentioned JPEG-XR. – Royi Aug 28 '16 at 12:38
• My typo, I was thinking about JPEG-XR. At which stage? – Laurent Duval Aug 28 '16 at 12:47
• @Drazick asking because I know some transforms are "close to" WPH, but not exact ones – Laurent Duval Aug 28 '16 at 12:49
• Have you looked on Wikipedia? (The link I gave)? I also tried searching for google.com/?ion=1&espv=2#q=JPEG+XR+hadamard+transform and got: intechopen.com/books/…, books.google.co.il/…. I think it might assist you. – Royi Aug 28 '16 at 17:44