LTI-Lib latest version v1.9 - last update 10 Apr 2010

ltiSplitImageToYIQ.h

00001 /*
00002  * Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
00003  * Lehrstuhl fuer Technische Informatik, RWTH-Aachen, Germany
00004  *
00005  * This file is part of the LTI-Computer Vision Library (LTI-Lib)
00006  *
00007  * The LTI-Lib is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU Lesser General Public License (LGPL)
00009  * as published by the Free Software Foundation; either version 2.1 of
00010  * the License, or (at your option) any later version.
00011  *
00012  * The LTI-Lib is distributed in the hope that it will be
00013  * useful, but WITHOUT ANY WARRANTY; without even the implied warranty
00014  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  * GNU Lesser General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU Lesser General Public
00018  * License along with the LTI-Lib; see the file LICENSE.  If
00019  * not, write to the Free Software Foundation, Inc., 59 Temple Place -
00020  * Suite 330, Boston, MA 02111-1307, USA.
00021  */
00022 
00023 
00024 /*----------------------------------------------------------------
00025  * project ....: LTI Digital Image/Signal Processing Library
00026  * file .......: ltiSplitImageToYIQ.h
00027  * authors ....: Pablo Alvarado, Stefan Syberichs, Thomas Rusert
00028  * organization: LTI, RWTH Aachen
00029  * creation ...: 19.04.99
00030  * revisions ..: $Id: ltiSplitImageToYIQ.h,v 1.5 2007/01/05 19:19:56 alvarado Exp $
00031  */
00032 
00033 #ifndef _LTI_SPLIT_IMAGE_TO_YIQ_H_
00034 #define _LTI_SPLIT_IMAGE_TO_YIQ_H_
00035 
00036 #include "ltiSplitImage.h"
00037 
00038 namespace lti {
00039 
00040   /**
00041    * Split image in its Luminance Inphase Quadrature channels.
00042    *
00043    * The following is an excerpt of
00044    * <a href="http://www.cs.rit.edu/~ncs/color/t_convert.html">this page</a>
00045    *
00046    * The YIQ system is the color primary system adopted by National
00047    * Television System Committee (NTSC) for color TV broadcasting. The
00048    * YIQ color solid is made by a linear transformation of the RGB
00049    * cube. Its purpose is to exploit certain characteristics of the
00050    * human eye to maximize the utilization of a fixed bandwidth. The
00051    * human visual system is more sensitive to changes in luminance
00052    * than to changes in hue or saturation, and thus a wider bandwidth
00053    * should be dedicated to luminance than to color information. Y is
00054    * similar to perceived luminance, I and Q carry color information
00055    * and some luminance information. The Y signal usually has 4.2 MHz
00056    * bandwidth in a 525 line system. Originally, the I and Q had
00057    * different bandwidths (1.5 and 0.6 MHz), but now they commonly
00058    * have the same bandwidth of 1 MHz.
00059    *
00060    * Here is the RGB -> YIQ conversion:
00061    *
00062    * \code
00063    * [ Y ]     [ 0.299   0.587   0.114 ] [ R ]
00064    * [ I ]  =  [ 0.596  -0.275  -0.321 ] [ G ]
00065    * [ Q ]     [ 0.212  -0.523   0.311 ] [ B ]
00066    * \endcode
00067    * Here is the YIQ -> RGB conversion:
00068    * \code
00069    * [ R ]     [ 1   0.956   0.621 ] [ Y ]
00070    * [ G ]  =  [ 1  -0.272  -0.647 ] [ I ]
00071    * [ B ]     [ 1  -1.105   1.702 ] [ Q ]
00072    * \endcode
00073    *
00074    * This color space is not used anymore.  Modern systems use the YUV, YCbCr
00075    * or YPbPr spaces instead.
00076    *
00077    * @see lti::splitImageToYUV, lti::splitImageToYCbCr, lti::splitImageToYPbPr
00078    *
00079    * @ingroup gColor
00080    */
00081   class splitImageToYIQ : public splitImage {
00082   public:
00083 
00084     /**
00085      * returns the name of this type
00086      */
00087     virtual const char* getTypename() const;
00088 
00089     /**
00090      * returns a pointer to a clone of the functor
00091      */
00092     virtual functor* clone() const;
00093 
00094     /**
00095      * split the image in YIQ.
00096      * YIQ splitting produces unnormalized channels !
00097      * @param img the image to be splitted
00098      * @param Y the perceived luminance
00099      * @param I color information and some luminance
00100      * @param Q color information and some luminance
00101      */
00102     virtual bool apply(const image& img,
00103                        channel& Y,
00104                        channel& I,
00105                        channel& Q) const;
00106 
00107     /**
00108      * split the image in YIQ.
00109      * YIQ splitting produces unnormalized channels !
00110      * @param img the image to be splitted
00111      * @param Y the perceived luminance
00112      * @param I color information and some luminance
00113      * @param Q color information and some luminance
00114      */
00115     virtual bool apply(const image& img,
00116                        channel8& Y,
00117                        channel8& I,
00118                        channel8& Q) const;
00119 
00120     /**
00121      * split the pixel in YIQ.
00122      * YIQ splitting produces unnormalized values !
00123      * @param pixel the pixel to be splitted
00124      * @param Y the perceived luminance
00125      * @param I color information and some luminance
00126      * @param Q color information and some luminance
00127      */
00128     virtual bool apply(const rgbPixel& pixel,
00129                        float& Y,
00130                        float& I,
00131                        float& Q) const;
00132 
00133     /**
00134      * split the pixel in YIQ.
00135      * YIQ splitting produces unnormalized values !
00136      * @param pixel the pixel to be splitted
00137      * @param Y the perceived luminance
00138      * @param I color information and some luminance
00139      * @param Q color information and some luminance
00140      */
00141     virtual bool apply(const rgbPixel& pixel,
00142                        ubyte& Y,
00143                        ubyte& I,
00144                        ubyte& Q) const;
00145   };
00146 
00147 
00148 } // namespace lti
00149 #endif

Generated on Sat Apr 10 15:26:14 2010 for LTI-Lib by Doxygen 1.6.1