00001 /*---------------------------------------------------------------------+ 00002 | Library QgarLib, graphics analysis and recognition | 00003 | Copyright (C) 2004 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 __DIST34IMAGE_H_INCLUDED__ 00029 #define __DIST34IMAGE_H_INCLUDED__ 00030 00031 00032 /** 00033 * @file Dist34Image.H 00034 * @brief Header file of class qgar::Dist34Image. 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 // For RCS/CVS use: Do not delete 00042 /* $Id: Dist34Image.H,v 1.1 2005/10/14 17:05:45 masini Exp $ */ 00043 00044 00045 // QGAR 00046 #include <qgarlib/GenImage.H> 00047 00048 00049 00050 namespace qgar 00051 { 00052 00053 /** 00054 * @ingroup IMGPROC_DIST 00055 * 00056 * @class Dist34Image Dist34Image.H "qgarlib/Dist34Image.H" 00057 * 00058 * @brief Distance transformation of all (black and white) components 00059 * of a binary image, using 3-4 Chamfer distance 00060 * 00061 * The result is stored in an image of <b>integer</b> numbers: 00062 * For a given pixel, the maximum value of the distance is the maximum 00063 * value of an <b>integer</b> number. 00064 * 00065 * @warning 00066 * The content of the rows and columns contiguous to the borders 00067 * of the resulting image is not relevant 00068 * (all these pixels have a value equal to <b>INT_MAX</b>) 00069 * 00070 * @todo 00071 * - In the constructor code, use pixel map pointers instead of nested 00072 * loops (for iCnt and for jCnt) to get less tests (and thus save time). 00073 * - The constructor performs a copy of the given image: If it is a 00074 * deep copy, is it really necessary? 00075 * - The way the distance is computed is rather weird: 00076 * See class qgar::Dist8cBlackCCImage for example! 00077 * - Given binary image <b>must</b> exclusively contain 0's and 1's. 00078 * 00079 * @author <a href="mailto:qgar-develop@loria.fr?subject=Qgar fwd Perrin & Kheder">Julien Perrin & Sami Kheder</a> 00080 * @date March 24, 2003 16:16 00081 * @since Qgar 2.1.1 00082 */ 00083 class Dist34Image 00084 00085 : public IntImage 00086 00087 { 00088 // ------------------------------------------------------------------- 00089 // T Y P E D E F I N I T I O N S 00090 // ------------------------------------------------------------------- 00091 public: 00092 00093 00094 /** @name Types */ 00095 // ===== 00096 //@{ 00097 00098 /** 00099 * @brief Type of the elements stored in the marker map. 00100 */ 00101 typedef IntImage::value_type value_type; 00102 00103 /** 00104 * @brief Reference to qgar::Dist34Image::value_type. 00105 */ 00106 typedef value_type& reference; 00107 00108 /** 00109 * @brief Constant reference to qgar::Dist34Image::value_type. 00110 */ 00111 typedef const value_type& const_reference; 00112 00113 /** 00114 * @brief Pointer to qgar::Dist34Image::value_type. 00115 */ 00116 typedef value_type* pointer; 00117 00118 /** 00119 * @brief Constant pointer to qgar::Dist34Image::value_type. 00120 */ 00121 typedef const value_type* const_pointer; 00122 00123 //@} 00124 00125 00126 // ------------------------------------------------------------------- 00127 // P U B L I C M E M B E R S 00128 // ------------------------------------------------------------------- 00129 public: 00130 00131 /** @name Constructors */ 00132 // ============ 00133 //@{ 00134 00135 /** 00136 * @brief Construct from given binary image. 00137 * 00138 * @param anImg a binary image 00139 */ 00140 Dist34Image(const BinaryImage& anImg); 00141 00142 //@} 00143 00144 // ------------------------------------------------------------------- 00145 }; // class Dist34Image 00146 00147 00148 } // namespace qgar 00149 00150 00151 #endif /* __DIST34IMAGE_H_INCLUDED__ */