Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

KanungoBinaryImage.H

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------+
00002  | Library QgarLib, graphics analysis and recognition                  |
00003  | Copyright (C) 2002  Qgar Project, LORIA                             |
00004  |                                                                     |
00005  | This library is free software; you can redistribute it and/or       |
00006  | modify it under the terms of the GNU Lesser General Public          |
00007  | License version 2.1, as published by the Free Software Foundation.  |
00008  |                                                                     |
00009  | This library is distributed in the hope that it will be useful,     |
00010  | but WITHOUT ANY WARRANTY; without even the implied warranty of      |
00011  | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.                |
00012  | See the GNU Lesser General Public License for more details.         |
00013  |                                                                     |
00014  | The GNU Lesser General Public License is included in the file       |
00015  | LICENSE.LGPL, in the root directory of the Qgar packaging. See      |
00016  | http://www.gnu.org/licenses/lgpl.html for the terms of the licence. |
00017  | To receive a paper copy, write to the Free Software Foundation,     |
00018  | Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.       |
00019  |                                                                     |
00020  | Contact Project Qgar for any information:                           |
00021  |   LORIA - équipe Qgar                                               |
00022  |   B.P. 239, 54506 Vandoeuvre-lès-Nancy Cedex, France                |
00023  |   email: qgar-contact@loria.fr                                      |
00024  |   http://www.qgar.org/                                              |
00025  *---------------------------------------------------------------------*/
00026 
00027 
00028 #ifndef __KANUNGOBINARYIMAGE_H_INCLUDED__
00029 #define __KANUNGOBINARYIMAGE_H_INCLUDED__
00030 
00031 
00032 /**
00033  * @file   KanungoBinaryImage.H
00034  * @brief  Header file of class qgar::KanungoBinaryImage.
00035  *
00036  * @author <a href="mailto:qgar-develop@loria.fr?subject=Qgar fwd Perrin & Kheder">Julien Perrin & Sami Kheder</a>
00037  * @date   March 24,  2003  16:16
00038  * @since  Qgar 2.1.1
00039  */
00040 
00041 
00042 /* $Id: KanungoBinaryImage.H,v 1.6 2005/10/14 17:05:47 masini Exp $ */
00043 
00044 
00045 
00046 // QGAR
00047 #include <qgarlib/GenImage.H>
00048 
00049 
00050 
00051 namespace qgar
00052 {
00053 
00054 /**
00055  * @ingroup IMGPROC_DEG
00056  *
00057  * @class KanungoBinaryImage KanungoBinaryImage.H "qgarlib/KanungoBinaryImage.H"
00058  *
00059  * @brief Degradation of a binary image,
00060  *   using Kanungo <i>et al</i>&nbsp;'s method.
00061  *
00062  * See
00063  * [<a href="Bibliography.html#Kanungo-et-al-2000">Kanungo&nbsp;et&nbsp;al,&nbsp;2000</a>]
00064  * for full details about the method.
00065  *
00066  * @todo To be documented!...
00067  *
00068  * @author <a href="mailto:qgar-develop@loria.fr?subject=Qgar fwd Perrin & Kheder">Julien Perrin & Sami Kheder</a>
00069  * @date   March 24,  2003  16:16
00070  * @since  Qgar 2.1.1
00071  */
00072 class KanungoBinaryImage
00073 
00074   : public BinaryImage
00075 
00076 {
00077 // -------------------------------------------------------------------
00078 // T Y P E   D E F I N I T I O N S
00079 // -------------------------------------------------------------------
00080 public:
00081 
00082   /** @name Types */
00083   //        =====
00084   //@{
00085 
00086   /**
00087    * @brief Type of the elements stored in the pixmap.
00088    */
00089   typedef BinaryImage::value_type value_type;
00090 
00091   /**
00092    * @brief Reference to qgar::KanungoBinaryImage::value_type.
00093    */
00094   typedef value_type& reference;
00095 
00096   /**
00097    * @brief Constant reference to qgar::KanungoBinaryImage::value_type.
00098    */
00099   typedef const value_type& const_reference;
00100 
00101   /**
00102    * @brief Pointer to qgar::KanungoBinaryImage::value_type.
00103    */
00104   typedef value_type* pointer;
00105 
00106   /**
00107    * @brief Constant pointer to qgar::KanungoBinaryImage::value_type.
00108    */
00109   typedef const value_type* const_pointer;
00110 
00111   //@}
00112 
00113 
00114 // -------------------------------------------------------------------
00115 // P U B L I C    M E M B E R S
00116 // -------------------------------------------------------------------
00117 public:
00118 
00119   /** @name Constructors */
00120   //        ============
00121   //@{
00122 
00123   /**
00124    * @brief Construct a degraded image from a given binary image.
00125   *      
00126    * If the provided structural element size
00127    * (argument <b>structEltSize</b>) is <b>0</b>, the final closing,
00128    * as described in Kanungo's method, is not performed.
00129    *
00130    * @param  anImg          image to be degraded
00131    * @param  alpha0         see Kanungo's method (default <b>1</b>)
00132    * @param  alpha          see Kanungo's method (default <b>2</b>)
00133    * @param  beta0          see Kanungo's method (default <b>1</b>)
00134    * @param  beta           see Kanungo's method (default <b>2</b>)
00135    * @param  eta            see Kanungo's method (default <b>0</b>)
00136    * @param  structEltSize  size of the square structutal element
00137    *   of the final closing (default <b>3</b>)
00138    */
00139   KanungoBinaryImage(BinaryImage& anImg, 
00140                      double alpha0 = 1.0, 
00141                      double alpha  = 2.0, 
00142                      double beta0  = 1.0, 
00143                      double beta   = 2.0, 
00144                      double eta    = 0.0, 
00145                      int structEltSize = 3);
00146 
00147   //@}
00148 
00149 // -------------------------------------------------------------------
00150 }; // class KanungoBinaryImage
00151 
00152 
00153 } // namespace qgar
00154 
00155 
00156 
00157 
00158 
00159 // HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH
00160 // HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH
00161 // H  E  L  P  E  R  S
00162 // HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH
00163 // HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH
00164 
00165 
00166 namespace qgar
00167 {
00168 
00169 
00170 /** @name Kanungo degradation helper functions */
00171 //        ====================================
00172 //@{
00173 
00174 /**
00175  * @ingroup GLOB_HELPER
00176  *
00177  * @brief Degrade a given image.
00178  *
00179  * If the provided structural element size is <b>0</b>
00180  * (argument <b>structEltSize</b>), the final closing,
00181  * as described in Kanungo's method, is not performed.
00182  *
00183  * @param  anImg          image to be degraded
00184  * @param  alpha0         see Kanungo's method (default <b>1</b>)
00185  * @param  alpha          see Kanungo's method (default <b>2</b>)
00186  * @param  beta0          see Kanungo's method (default <b>1</b>)
00187  * @param  beta           see Kanungo's method (default <b>2</b>)
00188  * @param  eta            see Kanungo's method (default <b>0</b>)
00189  * @param  structEltSize  size of the square structutal element
00190  *   of the final closing (default <b>3</b>)
00191  *
00192  * @exception qgar::QgarErrorInvalidArg
00193  *           (arg <b>structEltSize</b> cannot be negative)
00194  */
00195   void qgKanungoDegradation(BinaryImage& anImg,
00196                             double alpha0 = 1.0,
00197                             double alpha  = 2.0, 
00198                             double beta0  = 1.0, 
00199                             double beta   = 2.0, 
00200                             double eta    = 0.0, 
00201                             int structEltSize = 3)
00202     throw(QgarErrorInvalidArg);
00203 
00204 //@}
00205 
00206 
00207 } // namespace qgar 
00208 
00209 
00210 // HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH
00211 // HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH
00212 
00213 #endif /* __KANUNGOBINARYIMAGE_H_INCLUDED__ */
00214