latest version v1.9 - last update 10 Apr 2010 |
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 .......: ltiSplitImageToGSL.h 00027 * authors ....: Pablo Alvarado, Stefan Syberichs, Thomas Rusert 00028 * organization: LTI, RWTH Aachen 00029 * creation ...: 19.04.99 00030 * revisions ..: $Id: ltiSplitImageToGSL.h,v 1.4 2006/02/08 11:52:50 ltilib Exp $ 00031 */ 00032 00033 #ifndef _LTI_SPLIT_IMAGE_TO_GSL_H_ 00034 #define _LTI_SPLIT_IMAGE_TO_GSL_H_ 00035 00036 #include "ltiSplitImage.h" 00037 00038 namespace lti { 00039 00040 /** 00041 * Split image in its l1, l2 and l3 components, as described in 00042 * T. Gevers and A. Smeulders "Color-based object recognition" 00043 * Pattern Recognition, Vol. 32, 1999, pp. 453-464. 00044 * 00045 * This color space is appropriate when trying to detect only 00046 * material changes, but ignoring shadow, shape or highlight edges. 00047 * 00048 * The channels are defined as follows: 00049 * \f[ 00050 * \begin{aligned} 00051 * l_1 &= \frac{|R-G|}{|R-G| + |R-B| + |G-B|}\\ 00052 * l_2 &= \frac{|R-B|}{|R-G| + |R-B| + |G-B|}\\ 00053 * l_3 &= \frac{|G-B|}{|R-G| + |R-B| + |G-B|} 00054 * \end{aligned} 00055 * \f] 00056 * 00057 * There is no merge functor for this split method. 00058 * 00059 * @ingroup gColor 00060 */ 00061 class splitImageToGSL : public splitImage { 00062 public: 00063 /** 00064 * returns the name of this type 00065 */ 00066 virtual const char* getTypeName() const; 00067 00068 /** 00069 * returns a pointer to a clone of the functor. 00070 */ 00071 virtual functor* clone() const; 00072 00073 /** 00074 * split the image in red green and blue channels. 00075 * The values of each pixel will be between 0.0f and 1.0f 00076 * @param img the image to be splitted 00077 * @param l1 first channel 00078 * @param l2 second channel 00079 * @param l3 third channel 00080 */ 00081 virtual bool apply(const image& img, 00082 channel& l1, 00083 channel& l2, 00084 channel& l3) const; 00085 00086 /** 00087 * split the image in red green and blue channels. The values of 00088 * each pixel will be between 0 and 255 00089 * @param img the image to be splitted 00090 * @param l1 first channel 00091 * @param l2 second channel 00092 * @param l3 third channel 00093 */ 00094 virtual bool apply(const image& img, 00095 channel8& l1, 00096 channel8& l2, 00097 channel8& l3) const; 00098 00099 /** 00100 * split the pixel in red green and blue values. 00101 * The values of each pixel will be between 0.0f and 1.0f 00102 * @param pixel the pixel to be splitted 00103 * @param l1 first channel 00104 * @param l2 second channel 00105 * @param l3 third channel 00106 */ 00107 virtual bool apply(const rgbPixel& pixel, 00108 float& l1, 00109 float& l2, 00110 float& l3) const; 00111 00112 /** 00113 * split the pixel in red green and blue values. The values of 00114 * each pixel will be between 0 and 255 00115 * @param pixel the pixel to be splitted 00116 * @param l1 first channel 00117 * @param l2 second channel 00118 * @param l3 third channel 00119 */ 00120 virtual bool apply(const rgbPixel& pixel, 00121 ubyte& l1, 00122 ubyte& l2, 00123 ubyte& l3) const; 00124 00125 /** 00126 * Returns the first of the three channels into which the image is split. 00127 * If you need only one channel, this might be faster than calling apply(). 00128 * @param img the source image 00129 * @param l1 the extracted channel 00130 */ 00131 virtual bool getFirst(const image& img, channel& l1) const; 00132 00133 /** 00134 * Returns the first of the three channels into which the image is split. 00135 * If you need only one channel, this might be faster than calling apply(). 00136 * @param img the source image 00137 * @param l1 the extracted channel 00138 */ 00139 virtual bool getFirst(const image& img, channel8& l1) const; 00140 00141 /** 00142 * Returns the second of the three channels into which the image is split. 00143 * If you need only one channel, this might be faster than calling apply(). 00144 * @param img the source image 00145 * @param l2 the extracted channel 00146 */ 00147 virtual bool getSecond(const image& img, channel& l2) const; 00148 00149 /** 00150 * Returns the second of the three channels into which the image is split. 00151 * If you need only one channel, this might be faster than calling apply(). 00152 * @param img the source image 00153 * @param l2 the extracted channel 00154 */ 00155 virtual bool getSecond(const image& img, channel8& l2) const; 00156 00157 /** 00158 * Returns the third of the three channels into which the image is split. 00159 * If you need only one channel, this might be faster than calling apply(). 00160 * @param img the source image 00161 * @param l3 the extracted channel 00162 */ 00163 virtual bool getThird(const image& img, channel& l3) const; 00164 00165 /** 00166 * Returns the third of the three channels into which the image is split. 00167 * If you need only one channel, this might be faster than calling apply(). 00168 * @param img the source image 00169 * @param l3 the extracted channel 00170 */ 00171 virtual bool getThird(const image& img, channel8& l3) const; 00172 }; 00173 00174 } // namespace lti 00175 #endif