00001 #ifndef __ILargeLocalThresholdOp__ 00002 #define __ILargeLocalThresholdOp__ 00003 00004 00005 00038 #include <stdio.h> 00039 00040 #include "ILargeMorphologicalOp.hpp" 00041 00042 #include "ILargeErosionOp.hpp" 00043 #include "ILargeDilatationOp.hpp" 00044 00045 class ILargeLocalThresholdOp : public ILargeMorphologicalOp 00046 { 00047 protected: 00048 00049 bool applied; 00050 00051 int up; 00052 int low; 00053 00054 ILargeErosionOp erosion; // min 00055 ILargeDilatationOp dilatation; // max 00056 00057 protected: 00058 00059 virtual int operation(AnImage* src, int channel, int i, int j){return 0;} 00060 00061 public: 00062 00063 ILargeLocalThresholdOp(bool used=false) 00064 {low= 0; up= 255; applied= used;} 00065 ILargeLocalThresholdOp(int lowLabel, int upLabel, bool used=true) 00066 {low= lowLabel; up= upLabel; applied= used;} 00067 ILargeLocalThresholdOp(StructuredElement* aStructuredElement, int lowLabel=0, int upLabel=255, bool used=true); 00068 virtual ~ILargeLocalThresholdOp(){} 00069 00070 virtual void setUsage(bool use){ applied= use; } 00071 00072 virtual void setIterations(int iter){dilatation.setIterations(iter); erosion.setIterations(iter);} 00073 00074 virtual void setStructuredElement(StructuredElement* aStructuredElement); 00075 00076 virtual AnImage* filter(AnImage* src, AnImage* dest=0); 00077 00078 virtual void report(FILE* file){} 00079 }; 00080 00081 00082 #endif