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 () |
void | applyCanny32f (const core::ImgBase *dx, const core::ImgBase *dy, core::ImgBase *dst, int c) |
| applies canny for one channel
|
void | applyCanny16s (const core::ImgBase *dx, const core::ImgBase *dy, core::ImgBase *dst, int c) |
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.
Overview
The canny edge detector detects image borders from gray-scale images. It's result is an Img8u binary image containing thin borders.
Algorithm
The canny edge detector is a very common filter for edge detection, therefore it is already implemented in the IPP. The algorithm can be split into 3 major parts:
- Image differentiation here, image x and y gradients are computed. Commonly this is done using sobel- X and -Y filters.
- Non-Maximum suppression The image differentiation result is converted into an image intensity map and into a gradient direction map. Now all pixels are suppressed, that are not ridges in gradient intensity map mountain.
- Thresholding Here a special threshold operation is used. Two threshold values (l=low threshold and h=high threshold) split the edge intensity scale into 3 parts:
- below the lower threshold pixels with such values are in any case no border pixels
- above the upper threshold these pixels are border pixels
- in the middle section these pixels are only border pixels if there's a connected chain of other pixels (each also in the middle section) that is connected in any way to a border pixel.
(please see IPP's canny edge detector documentation for more detail)
pre-blur features
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 canny edge detector implementation overlooks these borders independent on the given threshold values.