Canny 边缘检测器
Canny 边缘检测器有助于:
- 良好检测:找到所有边缘
- 良好定位:找到的边缘尽可能接近图像中的“真实”边缘
- 最小响应:每个位置接受一个边缘响应,即避免多个紧密或相交边缘响应
源图像和 Canny 边缘检测后的结果
Canny 边缘检测器示例
Canny 边缘检测器只需要两个参数:
- 相关特征的特征尺度:用于平滑源图像的高斯滤波器的标准偏差。
- 滞后梯度阈值:源图像梯度的最大幅度表示为从 0 到 1 的分数(两个值)。
Canny边缘检测器的API是一个单独类, ,具有以下方法:
- Apply : applies the Canny edge detector on an image/ROI.
- GetHighThreshold : returns the high hysteresis threshold to consider that a pixel is an edge.
- GetLowThreshold : returns the low hysteresis threshold to consider that a pixel is an edge.
- GetSmoothingScale : returns the scale of the features of interest.
- GetThresholdingMode : returns the mode of the hysteresis thresholding.
- ResetSmoothingScale : prevents the smoothing of the source image by a Gaussian filter.
- SetHighThreshold : sets the high hysteresis threshold to consider that a pixel is an edge.
- SetLowThreshold : sets the low hysteresis threshold to consider that a pixel is an edge.
- SetSmoothingScale : sets the scale of the features of interest.
- SetThresholdingMode : sets the mode of the hysteresis thresholding.
结果图像必须与输入图像的尺寸相同。