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

ltiSplitImageToOCP.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 .......: ltiSplitImageToOCP.h
00027  * authors ....: Pablo Alvarado, Stefan Syberichs, Thomas Rusert
00028  * organization: LTI, RWTH Aachen
00029  * creation ...: 19.04.99
00030  * revisions ..: $Id: ltiSplitImageToOCP.h,v 1.4 2006/02/08 11:53:57 ltilib Exp $
00031  */
00032 
00033 #ifndef _LTI_SPLIT_IMAGE_TO_OCP_H_
00034 #define _LTI_SPLIT_IMAGE_TO_OCP_H_
00035 
00036 #include "ltiSplitImage.h"
00037 
00038 namespace lti {
00039 
00040   /**
00041    * Split image in an oponent colour system
00042    *
00043    * The three opponent channels are defined here as follows:
00044    * 
00045    * \f[ \begin{pmatrix}c1\\c2\\c3\end{pmatrix} =
00046    *     \begin{pmatrix} 0.5  & -0.5  & 0.0 \\
00047    *                    -0.25 & -0.25 & 0.5 \\
00048    *                     0.33 &  0.33 & 0.33\end{pmatrix} 
00049    *     \begin{pmatrix}R\\G\\B\end{pmatrix} 
00050    * \f]
00051    *
00052    *
00053    * @ingroup gColor
00054    */
00055   class splitImageToOCP : public splitImage {
00056   public:
00057 
00058     /**
00059      * returns the name of this type
00060      */
00061     virtual const char* getTypename() const;
00062 
00063     /**
00064      * returns a pointer to a clone of the functor
00065      */
00066     virtual functor* clone() const;
00067 
00068     /**
00069      * Get the three opponent color channels.
00070      * @param img input image to be split.
00071      * @param c1 Red - Green channel
00072      * @param c2 Blue - Yellow channel
00073      * @param c3 Intensity channel
00074      */
00075     virtual bool apply(const image& img,
00076                        channel& c1,
00077                        channel& c2,
00078                        channel& c3) const;
00079     /**
00080      * Get the three opponent color channels.
00081      * @param img input image to be split.
00082      * @param c1 Red - Green channel
00083      * @param c2 Blue - Yellow channel
00084      * @param c3 Intensity channel
00085      *
00086      * The original value range for the output channels should be
00087      * between -127.5 and 127.5.  The ubyte type cannot represent this
00088      * range, so the first two channels are scaled and shifted
00089      * by 127.5 to reach the desired output range from 0 to 255
00090      */
00091     virtual bool apply(const image& img,
00092                        channel8& c1,
00093                        channel8& c2,
00094                        channel8& c3) const;
00095 
00096     /**
00097      * on-copy
00098      */
00099     virtual bool apply(const rgbPixel& pixel,
00100                        float& c1,
00101                        float& c2,
00102                        float& c3) const;
00103     /**
00104      * on-copy
00105      */
00106     virtual bool apply(const rgbPixel& pixel,
00107                        ubyte& c1,
00108                        ubyte& c2,
00109                        ubyte& c3) const;
00110 
00111   };
00112 
00113 } // namespace lti
00114 #endif

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