00001 #ifndef __ILargeTopHatOp__ 00002 #define __ILargeTopHatOp__ 00003 00004 00005 00026 #include <stdio.h> 00027 00028 #include "ILargeMorphologicalOp.hpp" 00029 #include "StructuredElement.hpp" 00030 00031 class ILargeTopHatOp : public ILargeMorphologicalOp 00032 { 00033 protected: 00034 00035 bool blackHatTop; 00036 00037 bool maskFlag; 00038 int threshold1, threshold2; 00039 00040 bool background; 00041 bool crackArea; 00042 00043 ILargeMorphologicalOp* op; 00044 00045 protected: 00046 00047 virtual int operation(AnImage* src, int channel, int i, int j){return 0;} 00048 00049 public: 00050 00051 ILargeTopHatOp(int iter=1, bool aBlackHatTop=true); 00052 ILargeTopHatOp(StructuredElement* aStructuredElement, int iter=5, bool aBlackHatTop=true); 00053 virtual ~ILargeTopHatOp(){delete op;} 00054 00055 virtual void setMask(bool flag){maskFlag= flag;} 00056 virtual void setThreshold(int th1, int th2){threshold1= th1;threshold2= th2;} 00057 virtual int getLowThreshold(){return threshold1;} 00058 virtual int getUpperThreshold(){return threshold2;} 00059 00060 00061 virtual void setBackground( bool value ){background= value;} 00062 virtual void setCrackArea( bool value){crackArea= value;} 00063 00064 virtual void setIterations(int iter){op->setIterations(iter); } 00065 00066 virtual void setStructuredElement(StructuredElement* aStructuredElement) 00067 {op->setStructuredElement(aStructuredElement);} 00068 00069 virtual AnImage* filter(AnImage* src, AnImage* dest=0); 00070 00071 virtual void report(FILE* file){} 00072 }; 00073 00074 00075 #endif