Canny Edge Detector. More...

Functions

AFAPI array canny (const array &in, const cannyThreshold thresholdType, const float lowThresholdRatio, const float highThresholdRatio, const unsigned sobelWindow=3, const bool isFast=false)
 C++ Interface for canny edge detector. More...
 
AFAPI af_err af_canny (af_array *out, const af_array in, const af_canny_threshold threshold_type, const float low_threshold_ratio, const float high_threshold_ratio, const unsigned sobel_window, const bool is_fast)
 C Interface for canny edge detector. More...
 

Detailed Description

Canny Edge Detector.

The Canny edge detector is an edge detection operator that uses a multi-stage algorithm to detect a wide range of edges in images. A more in depth discussion on it can be found here.


Function Documentation

◆ af_canny()

AFAPI af_err af_canny ( af_array out,
const af_array  in,
const af_canny_threshold  threshold_type,
const float  low_threshold_ratio,
const float  high_threshold_ratio,
const unsigned  sobel_window,
const bool  is_fast 
)

C Interface for canny edge detector.

Parameters
[out]outis an binary array containing edges
[in]inis the input image
[in]threshold_typedetermines if user set high threshold is to be used or not. It can take values defined by the enum af_canny_threshold
[in]low_threshold_ratiois the lower threshold % of the maximum or auto-derived high threshold
[in]high_threshold_ratiois the higher threshold % of maximum value in gradient image used in hysteresis procedure. This value is ignored if AF_CANNY_THRESHOLD_AUTO_OTSU is chosen as af_canny_threshold
[in]sobel_windowis the window size of sobel kernel for computing gradient direction and magnitude
[in]is_fastindicates if L1 norm(faster but less accurate) is used to compute image gradient magnitude instead of L2 norm.
Returns
AF_SUCCESS if the moment calculation is successful, otherwise an appropriate error code is returned.

◆ canny()

AFAPI array af::canny ( const array in,
const cannyThreshold  thresholdType,
const float  lowThresholdRatio,
const float  highThresholdRatio,
const unsigned  sobelWindow = 3,
const bool  isFast = false 
)

C++ Interface for canny edge detector.

Parameters
[in]inis the input image
[in]thresholdTypedetermines if user set high threshold is to be used or not. It can take values defined by the enum af_canny_threshold
[in]lowThresholdRatiois the lower threshold % of maximum or auto-derived high threshold
[in]highThresholdRatiois the higher threshold % of maximum value in gradient image used in hysteresis procedure. This value is ignored if AF_CANNY_THRESHOLD_AUTO_OTSU is chosen as af_canny_threshold
[in]sobelWindowis the window size of sobel kernel for computing gradient direction and magnitude
[in]isFastindicates if L1 norm(faster but less accurate) is used to compute image gradient magnitude instead of L2 norm.
Returns
binary array containing edges
Examples
image_processing/edge.cpp.