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

blobify_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  ---------------------------------------------------------------------------
00010     <Add other copyrights here> 
00011  ---------------------------------------------------------------------------
00012 
00013     This file is part of Phission.
00014 
00015     Phission is free software; you can redistribute it and/or modify
00016     it under the terms of the GNU Lesser General Public License as published by
00017     the Free Software Foundation; either version 2 of the License, or
00018     (at your option) any later version.
00019 
00020     Phission is distributed in the hope that it will be useful,
00021     but WITHOUT ANY WARRANTY; without even the implied warranty of
00022     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00023     GNU Lesser General Public License for more details.
00024 
00025     You should have received a copy of the GNU Lesser General Public License
00026     along with Phission; if not, write to the Free Software
00027     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00028 
00029  ---------------------------------------------------------------------------*/
00030 #ifndef _BLOBIFY_FILTER_H
00031 #define _BLOBIFY_FILTER_H
00032 
00038 #include <phFilter.h>
00039 
00044 /* ---------------------------------------------------------------------- */
00048 typedef struct point_t
00049 {
00050     unsigned int x;
00051     unsigned int y;
00052 } blobify_point_type;
00053 
00054 /* ---------------------------------------------------------------------- */
00058 typedef struct blob_t
00059 {
00060     blobify_point_type ul;
00061     blobify_point_type lr;
00062     blobify_point_type cm;
00063     
00064     unsigned int mass;
00065     int next;
00066     int last;
00067 } blobify_blob_type;
00068 
00069 /* TODO: make a thread-safe object here for the blob info so that
00070  * any thread that calls "getResult" will copy the data out */
00071    
00072 #define blobify_MAXBLOBS 200
00073 
00074 /* ---------------------------------------------------------------------- */
00095 PHAPI(class) blobify_Filter : public phFilter 
00096 {
00097 private:
00098     int                 m_inChannel;
00099     int                 m_low;
00100     int                 m_high;
00101     int                 m_sortmethod;
00102     unsigned int        m_size;
00103     int                 m_drawBox;
00104 
00105     blobify_blob_type   m_bloblist[blobify_MAXBLOBS];
00106     unsigned int      **m_blobdata;
00107     unsigned int        m_blobdata_size;
00108     unsigned int        m_blobdataWidth;
00109     unsigned int        m_blobdataHeight;
00110 
00111     unsigned int       *m_blobdata_sizes;
00112     unsigned int        m_blobdata_sizes_size;
00113 
00114     phMutex             m_result_lock;
00115     unsigned long       m_result_size;
00116     unsigned long       m_result_copy_size;
00117     blobify_blob_type  *m_result_array;
00118     blobify_blob_type  *m_result_copy;
00119     int                 m_result_new;
00120     int                 m_result_inited;
00121     
00122 protected:
00123     int filter();
00124 
00125 public:
00126     blobify_Filter(int          inChannel   = 0, 
00127                    int          low         = 0, 
00128                    int          high        = 0, 
00129                    int          sortmethod  = 0, 
00130                    unsigned int size        = 0, 
00131                    int          drawBox     = 0 );
00132     ~blobify_Filter();
00133 
00134     int set(int             inChannel   = 0,
00135             int             low         = 0,
00136             int             high        = 0, 
00137             int             sortmethod  = 0, 
00138             unsigned int    size        = 0, 
00139             int             drawBox     = 0 );
00140 
00141     phFilter *cloneFilter();
00142 
00152     blobify_blob_type *getResult();
00153 };
00154  /* ImageProcessing */
00156 
00157 #endif /* _BLOBIFY_FILTER_H */




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