00001 /************************************************************************** 00002 ** Title: ConnectedComponentLabeling 00003 ** $RCSfile: ConnectedComponentLabeling.hh,v $ 00004 ** $Revision: 1.4 $$Name: $ 00005 ** $Date: 2005/05/02 11:25:37 $ 00006 ** Copyright: GPL $Author: fehr $ 00007 ** Description: 00008 ** 00009 ** 00010 ** 00011 **------------------------------------------------------------------------- 00012 ** 00013 ** $Log: ConnectedComponentLabeling.hh,v $ 00014 ** 00015 ** 00016 **************************************************************************/ 00017 00018 #ifndef CONNECTED_COMPONENT_LABELING 00019 #define CONNECTED_COMPONENT_LABELING 00020 00021 #include "IntImage.hh" 00022 #include <queue> 00023 00024 /*======================================================================*/ 00030 /*======================================================================*/ 00031 00032 class ConnectedComponentLabeling 00033 { 00034 public: 00035 /*======================================================================*/ 00039 /*======================================================================*/ 00040 ConnectedComponentLabeling() 00041 :NumberOfObjects(0) 00042 { 00043 //nothing else to do 00044 }; 00045 00046 /*======================================================================*/ 00052 void label(IntImage& image); 00053 00054 /*----------------------------------------------------------------------- 00055 * return number of labeled objects 00056 * \return number of labeled objects 00057 * ---------------------------------------------------------------------*/ 00058 int getNumberOfObjects(); 00059 private: 00060 std::queue<int> _todo; //queue of pixels still to process 00061 int NumberOfObjects; 00062 }; 00063 00064 00065 00066 00067 #endif