KSquare Utilities
KKB::MorphOpSobel Class Reference

#include <MorphOpSobel.h>

+ Inheritance diagram for KKB::MorphOpSobel:

Public Member Functions

 MorphOpSobel ()
 
 ~MorphOpSobel (void)
 
virtual OperationType Operation () const
 
virtual RasterPtr PerformOperation (Raster const *_image)
 
- Public Member Functions inherited from KKB::MorphOp
 MorphOp ()
 
virtual ~MorphOp ()
 
OperationType OperationTypeFromStr (const KKB::KKStr &_operationStr)
 
KKB::KKStr OperationTypeToStr (OperationType _operation)
 

Additional Inherited Members

- Public Types inherited from KKB::MorphOp
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 }
 
- Static Public Member Functions inherited from KKB::MorphOp
static kkint32 Biases (MaskTypes mt)
 
static StructureType MaskShapes (MaskTypes mt)
 
- Protected Member Functions inherited from KKB::MorphOp
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 inherited from KKB::MorphOp
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 inherited from KKB::MorphOp
static kkint32 biases []
 
static StructureType maskShapes []
 

Detailed Description

Definition at line 18 of file MorphOpSobel.h.

Constructor & Destructor Documentation

MorphOpSobel::MorphOpSobel ( )

Definition at line 23 of file MorphOpSobel.cpp.

23  :
24  magnitudeSqrTable (NULL),
25  maxMagnitude (0)
26 {
27 }
MorphOpSobel::~MorphOpSobel ( void  )

Definition at line 29 of file MorphOpSobel.cpp.

30 {
31  DeleteMagnitudeSqrTable ();
32 }

Member Function Documentation

virtual OperationType KKB::MorphOpSobel::Operation ( ) const
inlinevirtual
RasterPtr MorphOpSobel::PerformOperation ( Raster const *  _image)
virtual

Implements KKB::MorphOp.

Definition at line 62 of file MorphOpSobel.cpp.

References KKB::Raster::Color(), KKB::Raster::CreateGrayScaleKLT(), and KKB::MorphOp::SetSrcRaster().

Referenced by KKB::Raster::SobelEdgeDetector().

63 {
64  if (!_image)
65  return NULL;
66 
67  bool weOwnRaster = false;
68  if (_image->Color ())
69  {
70  _image = _image->CreateGrayScaleKLT ();
71  weOwnRaster = true;
72  }
73 
74  SetSrcRaster (_image);
75 
76  BuildMagnitudeSqrTable ();
77 
78  if (weOwnRaster)
79  delete _image;
80  _image = NULL;
81 
82  return BuildMagnitudeImage();
83 } /* PerformOperation */
void SetSrcRaster(RasterConstPtr _srcRaster)
Definition: MorphOp.cpp:149

The documentation for this class was generated from the following files: