eLynx SDK v3.3.0
C++ image processing API reference

How to add an image filter to eLynx project?

Here is a trip into pixel and image classes.


To illustrate the tutorial let's add the Colorize filter.

Now to go deeper into the filter implementation, follow these steps:


Theory of Colorize pixel processing

The Colorize filter sets the hue and the saturation of an image.

colorize1.png


Original image

colorize2.png

Sepia tone: Hue=0.10, Saturation=0.54
colorize3.png

Green tone: Hue=0.33, Saturation=0.84

Colorize an image is a simple point to point processing algorithm. Suppose we get a pixel coded in HLS color space, then Colorize is just setting the hue and saturation values.
We could write a generalized pixel service:

template<class Pixel> 
void elxColorize(Pixel& ioPixel, 
    typename Pixel::type iHue, 
    typename Pixel::type iSaturation);

Where implementation for PixelHLS is trivial:

template<typename T>
void elxColorize(PixelHLS<T>& ioPixel, T iHue, T iSaturation)
{
  ioPixel._hue = iHue;
  ioPixel._saturation = iSaturation;
}

The generalization for all other pixel types is explained here: How to add pixel services?

Now with this pixel service we can write a simple image algorithm:

for each image's pixel
  elxColorize(pixel, iHue, iSaturation)

Implementation of image services is explained here: How to add image services?

Go to top


Colorize filter implementation overview

The final goal of image filter is an user friendly tool to adjust parameters and see how they affect the resulting image. This filter could be available from the eLynx lab application.

colorizePanel1.png

Filter with default values, Sepia tone.
colorizePanel2.png

Filter with modified values for blue tone.

To add a filter to eLynx lab application you need to (from top to bottom dependency):

Go to top


Generated on Thu Dec 9 2010 by doxygen 1.7.2