![]() |
KSquare Utilities
|
Base class for all Morphological operations. More...
#include <MorphOp.h>
Inheritance diagram for KKB::MorphOp:Public Types | |
| enum | MaskTypes : int { MaskTypes::CROSS3 = 0, MaskTypes::CROSS5 = 1, MaskTypes::SQUARE3 = 2, MaskTypes::SQUARE5 = 3, MaskTypes::SQUARE7 = 4, MaskTypes::SQUARE9 = 5, MaskTypes::SQUARE11 = 6 } |
| enum | OperationType { OperationType::Null, OperationType::Binarize, OperationType::BmiFiltering, OperationType::ConvexHull, OperationType::Dilation, OperationType::Erosion, OperationType::MaskExclude, OperationType::SobelEdgeDetection, OperationType::Stretcher } |
| enum | StructureType : int { StructureType::Null, StructureType::stCross, StructureType::stSquare } |
Public Member Functions | |
| MorphOp () | |
| virtual | ~MorphOp () |
| virtual OperationType | Operation () const =0 |
| OperationType | OperationTypeFromStr (const KKB::KKStr &_operationStr) |
| KKB::KKStr | OperationTypeToStr (OperationType _operation) |
| virtual RasterPtr | PerformOperation (Raster const *_image)=0 |
Static Public Member Functions | |
| static kkint32 | Biases (MaskTypes mt) |
| static StructureType | MaskShapes (MaskTypes mt) |
Protected Member Functions | |
| bool | BackgroundPixel (uchar pixel) const |
| bool | BackgroundPixel (kkint32 row, kkint32 col) const |
| bool | ForegroundPixel (uchar pixel) const |
| bool | ForegroundPixel (kkint32 row, kkint32 col) const |
| void | SetSrcRaster (RasterConstPtr _srcRaster) |
Protected Attributes | |
| uchar | backgroundPixelTH |
| uchar | backgroundPixelValue |
| uchar *const * | srcBlue |
| uchar const * | srcBlueArea |
| bool | srcColor |
| uchar *const * | srcGreen |
| uchar const * | srcGreenArea |
| kkint32 | srcHeight |
| RasterConstPtr | srcRaster |
| uchar *const * | srcRed |
| uchar const * | srcRedArea |
| kkint32 | srcWidth |
Static Protected Attributes | |
| static kkint32 | biases [] |
| static StructureType | maskShapes [] |
Base class for all Morphological operations.
Creates a image where the only pixels that are passed thru are the ones that would be removed by the specified mask when a Open-Dilatation operation are performed.
Meant to be the base class to all Morphological operators.
It is assumed that all morphologocal operations will be working with a source image and returning a new modified image; the atcual operation is to be perfomed by the "PerformOperation" metho where you pass in a poiter to the source Image/ Raster. The the derived class would then call "SetSrcRaster" to intialize the base class "MorphOp" with pointers to the source image.
|
strong |
|
strong |
|
strong |
| MorphOp::MorphOp | ( | ) |
Definition at line 73 of file MorphOp.cpp.
References backgroundPixelTH, backgroundPixelValue, srcBlue, srcBlueArea, srcColor, srcGreen, srcGreenArea, srcHeight, srcRaster, srcRed, srcRedArea, and srcWidth.
Referenced by KKB::ConvexHull::ConvexHull(), KKB::MorphOpBinarize::MorphOpBinarize(), KKB::MorphOpBmiFiltering::MorphOpBmiFiltering(), KKB::MorphOpMaskExclude::MorphOpMaskExclude(), KKB::MorphOpStretcher::MorphOpStretcher(), and KKB::MorphOpStruct::MorphOpStruct().
|
virtual |
Definition at line 91 of file MorphOp.cpp.
|
protected |
Definition at line 171 of file MorphOp.cpp.
References backgroundPixelTH.
Referenced by KKB::MorphOpStruct::Fit(), KKB::MorphOpStruct::FitBackgroundCount(), and KKB::MorphOpDilation::PerformOperation().
Definition at line 178 of file MorphOp.cpp.
References backgroundPixelTH, srcGreen, srcHeight, and srcWidth.
Definition at line 44 of file MorphOp.cpp.
References biases, CROSS3, and SQUARE9.
Referenced by KKB::Raster::Erosion(), KKB::Raster::ErosionBoundary(), KKB::Raster::ErosionChanged(), KKB::Raster::ErosionChanged1(), and KKB::Raster::Raster().
|
protected |
Definition at line 195 of file MorphOp.cpp.
References backgroundPixelTH.
Referenced by KKB::MorphOpStruct::HitForegroundCount(), KKB::MorphOpDilation::PerformOperation(), and KKB::MorphOpErosion::PerformOperation().
Definition at line 202 of file MorphOp.cpp.
References backgroundPixelTH, srcGreen, srcHeight, and srcWidth.
Referenced by KKB::ConvexHull::Store().
|
static |
Definition at line 57 of file MorphOp.cpp.
References CROSS3, maskShapes, and SQUARE9.
Referenced by KKB::Raster::Erosion(), KKB::Raster::ErosionBoundary(), KKB::Raster::ErosionChanged(), and KKB::Raster::ErosionChanged1().
|
pure virtual |
| MorphOp::OperationType MorphOp::OperationTypeFromStr | ( | const KKB::KKStr & | _operationStr | ) |
Definition at line 123 of file MorphOp.cpp.
References Binarize, BmiFiltering, ConvexHull, KKB::KKStr::EqualIgnoreCase(), Erosion, MaskExclude, Null, and Stretcher.
| KKB::KKStr MorphOp::OperationTypeToStr | ( | OperationType | _operation | ) |
Definition at line 97 of file MorphOp.cpp.
References BmiFiltering, ConvexHull, Dilation, Erosion, MaskExclude, and Stretcher.
Implemented in KKB::MorphOpSobel.
|
protected |
Definition at line 149 of file MorphOp.cpp.
References backgroundPixelTH, KKB::Raster::BackgroundPixelTH(), backgroundPixelValue, KKB::Raster::BackgroundPixelValue(), KKB::Raster::Blue(), KKB::Raster::BlueArea(), KKB::Raster::Color(), KKB::Raster::Green(), KKB::Raster::GreenArea(), KKB::Raster::Height(), KKB::Raster::Red(), KKB::Raster::RedArea(), srcBlue, srcBlueArea, srcColor, srcGreen, srcGreenArea, srcHeight, srcRaster, srcRed, srcRedArea, srcWidth, and KKB::Raster::Width().
Referenced by KKB::ConvexHull::Filter(), KKB::MorphOpSobel::PerformOperation(), KKB::MorphOpBmiFiltering::PerformOperation(), KKB::MorphOpDilation::PerformOperation(), KKB::MorphOpErosion::PerformOperation(), KKB::MorphOpBinarize::PerformOperation(), KKB::MorphOpStretcher::PerformOperation(), KKB::MorphOpMaskExclude::PerformOperation(), and KKB::ConvexHull::PerformOperation().
|
protected |
Definition at line 109 of file MorphOp.h.
Referenced by BackgroundPixel(), ForegroundPixel(), MorphOp(), and SetSrcRaster().
|
protected |
Definition at line 110 of file MorphOp.h.
Referenced by MorphOp(), and SetSrcRaster().
|
staticprotected |
|
staticprotected |
Definition at line 127 of file MorphOp.h.
Referenced by MaskShapes().
|
protected |
Definition at line 120 of file MorphOp.h.
Referenced by MorphOp(), KKB::MorphOpStretcher::PerformOperation(), and SetSrcRaster().
|
protected |
Definition at line 116 of file MorphOp.h.
Referenced by MorphOp(), KKB::MorphOpMaskExclude::PerformOperation(), and SetSrcRaster().
|
protected |
Definition at line 122 of file MorphOp.h.
Referenced by MorphOp(), KKB::MorphOpMaskExclude::PerformOperation(), and SetSrcRaster().
|
protected |
Definition at line 119 of file MorphOp.h.
Referenced by BackgroundPixel(), KKB::MorphOpStruct::Fit(), KKB::MorphOpStruct::FitBackgroundCount(), ForegroundPixel(), KKB::MorphOpStruct::HitForegroundCount(), MorphOp(), KKB::MorphOpDilation::PerformOperation(), KKB::MorphOpBinarize::PerformOperation(), KKB::MorphOpErosion::PerformOperation(), KKB::MorphOpStretcher::PerformOperation(), and SetSrcRaster().
|
protected |
Definition at line 115 of file MorphOp.h.
Referenced by MorphOp(), KKB::MorphOpMaskExclude::PerformOperation(), and SetSrcRaster().
|
protected |
Definition at line 123 of file MorphOp.h.
Referenced by BackgroundPixel(), KKB::ConvexHull::Filter(), KKB::MorphOpStruct::Fit(), KKB::MorphOpStruct::FitBackgroundCount(), ForegroundPixel(), KKB::MorphOpStruct::HitForegroundCount(), MorphOp(), KKB::MorphOpErosion::PerformOperation(), KKB::MorphOpBinarize::PerformOperation(), KKB::MorphOpDilation::PerformOperation(), KKB::MorphOpStretcher::PerformOperation(), KKB::MorphOpMaskExclude::PerformOperation(), and SetSrcRaster().
|
protected |
Definition at line 112 of file MorphOp.h.
Referenced by MorphOp(), KKB::MorphOpBmiFiltering::PerformOperation(), KKB::MorphOpErosion::PerformOperation(), KKB::MorphOpBinarize::PerformOperation(), KKB::MorphOpDilation::PerformOperation(), KKB::ConvexHull::PerformOperation(), and SetSrcRaster().
|
protected |
Definition at line 118 of file MorphOp.h.
Referenced by MorphOp(), KKB::MorphOpStretcher::PerformOperation(), and SetSrcRaster().
|
protected |
Definition at line 114 of file MorphOp.h.
Referenced by MorphOp(), KKB::MorphOpMaskExclude::PerformOperation(), and SetSrcRaster().
|
protected |
Definition at line 124 of file MorphOp.h.
Referenced by BackgroundPixel(), KKB::ConvexHull::Filter(), KKB::MorphOpStruct::Fit(), KKB::MorphOpStruct::FitBackgroundCount(), ForegroundPixel(), KKB::MorphOpStruct::HitForegroundCount(), MorphOp(), KKB::MorphOpErosion::PerformOperation(), KKB::MorphOpBinarize::PerformOperation(), KKB::MorphOpDilation::PerformOperation(), KKB::MorphOpStretcher::PerformOperation(), KKB::MorphOpMaskExclude::PerformOperation(), and SetSrcRaster().