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

histogram_Filter.h

Go to the documentation of this file.
00001 /* ---------------------------------------------------------------------------
00002     Phission :
00003         Realtime Vision Processing System
00004 
00005     Copyright (C) 2003-2006 Philip D.S. Thoren (pthoren@cs.uml.edu)
00006     University of Massachusetts at Lowell,
00007     Laboratory for Artificial Intelligence and Robotics
00008 
00009     This file is part of Phission.
00010 
00011     Phission is free software; you can redistribute it and/or modify
00012     it under the terms of the GNU Lesser General Public License as published by
00013     the Free Software Foundation; either version 2 of the License, or
00014     (at your option) any later version.
00015 
00016     Phission is distributed in the hope that it will be useful,
00017     but WITHOUT ANY WARRANTY; without even the implied warranty of
00018     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019     GNU Lesser General Public License for more details.
00020 
00021     You should have received a copy of the GNU Lesser General Public License
00022     along with Phission; if not, write to the Free Software
00023     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00024 
00025  ---------------------------------------------------------------------------*/
00026 #ifndef _HISTOGRAM_FILTER_H
00027 #define _HISTOGRAM_FILTER_H
00028 
00034 #include <phHistogramData.h>
00035 #include <phFilter.h>
00036 
00042 /* ------------------------------------------------------------------------ */
00066 PHAPI(class) histogram_Filter : public phFilter
00067 {
00068 protected:
00069     uint32_t m__x1;
00070     uint32_t m__y1;
00071     uint32_t m__x2;
00072     uint32_t m__y2;
00073     
00074     int m_useCoords;
00075     int m_useBox;
00076     int m_useBoxWithCoords;
00077     
00078     uint32_t m_x1;
00079     uint32_t m_y1;
00080     uint32_t m_x2;
00081     uint32_t m_y2;
00082     
00083     uint32_t m_x;
00084     uint32_t m_y;
00085     double m_x_boxSize;
00086     double m_y_boxSize;
00087 
00088     uint32_t m_lastWidth;
00089     uint32_t m_lastHeight;
00090     uint32_t m_updateBox;
00091 
00092     uint32_t m_binCount;
00093 
00094     phColor m_maxbin_color;
00095     phColor m_maxbin_threshold;
00096     
00097 #if 1
00098     phColor m_color;
00099     phColor m_threshold;
00100 #else 
00101     phColor m_mid_color;
00102     phColor m_ave_threshold;
00103 
00104     phColor m_color;
00105     phColor m_upper_threshold;
00106     phColor m_lower_threshold;
00107 #endif
00108     /* Each of these has depth * nbins elements */
00109     /* For a depth of 3, the elements are stored:
00110      *   [ bin0-d0 ][ bin0-d1 ][ bin0-d2 ][ bin1-d0 ][ bin1-d1 ][ bin1-d2 ]... */
00111     /* total value of the elements collected for the bin */
00112     uint32_t *m_binVal;
00113     /* total elements in bin */
00114     uint32_t *m_binCnt;
00115     /* average of the bin */
00116     uint32_t *m_binAvg;
00117     /* [from peak bin count] average value of that bin for each channel */
00118     uint32_t *m_maxAvg;
00119     /* [from peak bin count] total entries in that bin for each channel */
00120     uint32_t *m_maxCnt;
00121     /* [from peak bin count] the bin index for each channel */
00122     uint32_t *m_maxBin;
00123 
00124     uint32_t m_binVal_size;
00125     uint32_t m_binCnt_size;
00126     uint32_t m_binAvg_size;
00127     uint32_t m_maxAvg_size;
00128     uint32_t m_maxCnt_size;
00129     uint32_t m_maxBin_size;
00130 
00131     phHistogramData m_histogramData;
00132 
00133     phColor     *m_outcolor;
00134     uint32_t    m_outcolor_size;
00135     uint32_t    m_outputFormat;
00136     int         m_draw_rect;
00137     
00138     int do_draw_rect_maybe(uint32_t x1, uint32_t y1, 
00139                            uint32_t x2, uint32_t y2);
00140     
00141     int filter();
00142 
00143 public:
00144     histogram_Filter(uint32_t x1 = 0, uint32_t y1 = 0, 
00145                      uint32_t x2 = 0, uint32_t y2 = 0, 
00146                      uint32_t bins = 0, uint32_t draw_rect = 0,
00147                      phColor *outcolor = NULL );
00148     ~histogram_Filter();
00149     
00150     int set(uint32_t x1 = 0, uint32_t y1 = 0, 
00151             uint32_t x2 = 0, uint32_t y2 = 0, 
00152             uint32_t bins = 0, uint32_t draw_rect = 0,
00153             phColor *outcolor = NULL );
00154     
00155     int setBoxSize(double width_size, double height_size );
00156     int setBoxSize(double size );
00157     int setBox(double width_size, double height_size,
00158                uint32_t x, uint32_t y );
00159     int setBox(double size, uint32_t x, uint32_t y );
00160     
00161     int setBoxCoords(uint32_t x1, 
00162                      uint32_t y1, 
00163                      uint32_t x2, 
00164                      uint32_t y2 );
00165     int setBinCount ( uint32_t bins     );
00166     int setDrawRect ( uint32_t draw_rect);
00167     int setOutcolor ( phColor outcolor  );
00168    
00169     int getHistogramData( phHistogramData &copyto );
00170     phLiveObject *getLiveHistogramOutput();
00171     
00172     phFilter *cloneFilter();
00173 };
00174  /* ImageProcessing */
00176 
00177 #endif /* _HISTOGRAM_FILTER_H */
00178 




Copyright (C) 2002 - 2007 Philip D.S. Thoren ( pthoren@users.sourceforge.net )
University Of Massachusetts at Lowell
Robotics Lab
SourceForge.net Logo

Generated on Sat Jun 16 02:44:08 2007 for phission by  doxygen 1.4.4