DLLogoDetect.h

Go to the documentation of this file.
00001 #ifndef _DLLOGODETECT_H_
00002 #define _DLLOGODETECT_H_
00003 
00004 #include "DLLogoDetect.h"
00005 #include "DLImage.h"
00006 #include "DLComponent.h"
00007 #include "DLConnectedComponents.h"
00008 #include "DLBitsPerPixelConverter.h"
00009 #include "DLZone.h"
00010 
00013 const double MIN_SCORE = 700.0;
00014 
00039 struct DLLogoCandidate
00040 {
00042         DLZone logoRegion;
00044         string sourceImageName;
00046         unsigned long scores;
00047 };
00048 
00049 
00050 class DLLogoDetect
00051 {
00052 public:
00053 
00061         DLLogoDetect(const char* fname, double threshold=MIN_SCORE);
00062 
00071         DLLogoDetect(const DLImage &srcImage, const char* fname, double threshold=MIN_SCORE);
00072 
00077         list <DLLogoCandidate> dlGetDetectedLogos() { return logoList; };
00078 
00083         bool dlGotLogo() { return !logoList.empty(); };
00084 
00085 
00086 private:
00087 
00094     void dlDetectLogo(double threshold);
00095 
00101      int dlFisherClassify(const DLComponent & ccListi);
00102      
00108          double dlComputeSpatialDensity(const DLComponent & ccListi);
00109 
00119          bool dlCascadeClassify(const DLComponent ccListi, int *origin, int *size);
00120 
00129          bool dlMultiScaleDetect(int regOriginX, int regOriginY, int regWidth, int regHeight);
00130 
00132          string sourceImageName;
00133 
00135          DLImage sourceImage;
00136 
00138          int normalizedWidth;
00139          int grayThreshold;
00140          int width, height;
00141 
00143          double hRes;
00145          double vRes;
00146 
00147          int i1, i2, i3, i4, i5, i6, i7, i8, i9;
00148          float f1, f2;
00149 
00151         list <DLLogoCandidate> logoList;
00152 
00153 };//end class
00154 
00155 #endif //_DLLOGODETECT_H_

LogoDetectDOCLIB Library is an add-on of DOCLIB. DOCLIB is being developed under contract by a collaboration between:
The Laboratory for Language and Media Processing
Unviersity of Maryland, College Park
and
Booz | Allen | Hamilton

All Rights Reserved, 2003-2007