Image Component Library (ICL)
|
Class for the canny edge detector (IPP only!) More...
#include <CannyOp.h>
Public Member Functions | |
CannyOp (icl32f lowThresh=0, icl32f highThresh=255, int preBlurRadius=0) | |
Constructor. | |
CannyOp (UnaryOp *dxOp, UnaryOp *dyOp, icl32f lowThresh=0, icl32f highThresh=255, bool deleteOps=true, int preBlurRadius=0) | |
Constructor. | |
virtual | ~CannyOp () |
Destructor. | |
void | setThresholds (icl32f lowThresh, icl32f highThresh) |
changes the Thresholds | |
icl32f | getLowThreshold () const |
returns the lower threshold | |
icl32f | getHighThreshold () const |
returns the upper threshold | |
virtual void | apply (const core::ImgBase *src, core::ImgBase **dst) |
applies the Canny Operator | |
void | setPreBlurRadius (int preBlurRadius) |
sets the pre-blur-radius | |
bool | getPreBlurRadius () const |
returns current pre-blur feature state | |
Private Member Functions | |
void | setUpPreBlurOp () |
Private Attributes | |
std::vector< icl8u > | m_cannyBuf |
buffer for ippiCanny | |
core::ImgBase * | m_derivatives [2] |
UnaryOp * | m_ops [2] |
UnaryOp * | m_preBlurOp |
icl32f | m_lowT |
icl32f | m_highT |
bool | m_ownOps |
core::Img32f | m_buffer |
int | m_preBlurRadius |
Class for the canny edge detector (IPP only!)
The canny edge detector detects image borders from gray-scale images. It's result is an Img8u binary image containing thin borders.
The canny edge detector is a very common filter for edge detection, therefore it is already implemented in the IPP. Currently no non-IPP implementation is available. The algorithm can be split into 3 major parts:
(please see IPP's canny edge detector documentation for more detail)
In some cases (e.g. if input images are created synthetically) the border intensity image has too hard edges (e.g. from edges from black to white). In this case, the IPP canny edge detector implementation overlooks these borders independent on the given threshold values.
icl::filter::CannyOp::CannyOp | ( | icl32f | lowThresh = 0 , |
icl32f | highThresh = 255 , |
||
int | preBlurRadius = 0 |
||
) |
Constructor.
With this Constructor the derivations are computed within the CannyOp. If you already have computed the derivations, use the other Constructor, due to performance reasons.
lowThresh | lower threshold |
highThresh | upper threshold |
preBlurRadius | if r> 0, gaussian kernel with masksize r*2+1 is applied to the input image first |
icl::filter::CannyOp::CannyOp | ( | UnaryOp * | dxOp, |
UnaryOp * | dyOp, | ||
icl32f | lowThresh = 0 , |
||
icl32f | highThresh = 255 , |
||
bool | deleteOps = true , |
||
int | preBlurRadius = 0 |
||
) |
Constructor.
dxOp | the x derivation of the src |
dyOp | the y derivation of the src |
lowThresh | lower threshold |
highThresh | upper threshold |
deleteOps | should the internaly created derivations be deleted? |
preBlurRadius | if r> 0, gaussian kernel with masksize r*2+1 is applied to the input image first |
virtual icl::filter::CannyOp::~CannyOp | ( | ) | [virtual] |
Destructor.
virtual void icl::filter::CannyOp::apply | ( | const core::ImgBase * | src, |
core::ImgBase ** | dst | ||
) | [virtual] |
applies the Canny Operator
src | the source image |
dst | pointer to the destination image |
Implements icl::filter::UnaryOp.
icl32f icl::filter::CannyOp::getHighThreshold | ( | ) | const |
returns the upper threshold
icl32f icl::filter::CannyOp::getLowThreshold | ( | ) | const |
returns the lower threshold
bool icl::filter::CannyOp::getPreBlurRadius | ( | ) | const [inline] |
returns current pre-blur feature state
void icl::filter::CannyOp::setPreBlurRadius | ( | int | preBlurRadius | ) | [inline] |
sets the pre-blur-radius
if r> 0, gaussian kernel with masksize r*2+1 is applied to the input image first
void icl::filter::CannyOp::setThresholds | ( | icl32f | lowThresh, |
icl32f | highThresh | ||
) |
changes the Thresholds
lowThresh | lower threshold |
highThresh | upper threshold |
void icl::filter::CannyOp::setUpPreBlurOp | ( | ) | [private] |
core::Img32f icl::filter::CannyOp::m_buffer [private] |
std::vector<icl8u> icl::filter::CannyOp::m_cannyBuf [private] |
buffer for ippiCanny
core::ImgBase* icl::filter::CannyOp::m_derivatives[2] [private] |
icl32f icl::filter::CannyOp::m_highT [private] |
icl32f icl::filter::CannyOp::m_lowT [private] |
UnaryOp* icl::filter::CannyOp::m_ops[2] [private] |
bool icl::filter::CannyOp::m_ownOps [private] |
UnaryOp* icl::filter::CannyOp::m_preBlurOp [private] |
int icl::filter::CannyOp::m_preBlurRadius [private] |