边缘检测算法6.-Paillou边缘检测

在 OpenCV扩展模块里面,有一个算法:

paillou定义的 边缘检测

查资料,了解是 1997年 Paillou 提出来的 改进 SAR图像的 边缘检测方法。

论文在这个地方:https://ieeexplore.ieee.org/document/551947

The author presents a new linear edge detector that is very well suited to process noisy images. Performances of the new operator have been evaluated using Canny's criteria together with experimental comparison results on a noisy SAR image.

一种新的 边缘检测,对 噪声图像适应性比较好。

话不多说,测试效果。

调用如下:

 const Mat& src = ......
int cn = src.channels();
Mat ret;
if (direction == "both")
{
Mat hMat, vMat;
ximgproc::GradientPaillouX(src, hMat, alpha, omega);
ximgproc::GradientPaillouY(src, vMat, alpha, omega);
if (resType == "abs")
{
hMat = abs(hMat);
vMat = abs(vMat);
}
else if (resType == "cast")
{
hMat.convertTo(hMat, CV_8UC(cn));
vMat.convertTo(vMat, CV_8UC(cn));
}
ret = hMat + vMat;
}
else if (direction == "horizontal")
{
ximgproc::GradientPaillouX(src, ret, alpha, omega);
if (resType == "abs")
ret = abs(ret);
else if (resType == "cast")
ret.convertTo(ret, CV_8UC(cn));
}
else if (direction == "vertical")
{
ximgproc::GradientPaillouY(src, ret, alpha, omega);
if (resType == "abs")
ret = abs(ret);
else if (resType == "cast")
ret.convertTo(ret, CV_8UC(cn));
}
cv::normalize(ret, _dst, 0, 255, cv::NORM_MINMAX, CV_8UC(cn));//归一化到 0~255之间
dst = _dst;

alpha=2,omega=1;边缘较粗

alpha=20,omega=1;边缘变细

测试 Canny 算法

水平/竖直 paillou 传递给 Canny算法

这个边缘检测 算法效果应该比 Sobel好一点,不过 alpha,omega 参数比较难以设置。

项目中,很少用这些算法,毕竟不是很稳定的算法。不过,可以扩展 对 边缘检测算法的眼界。

我遇到不少搞图像处理的,居然连最基本的边缘检测 Sobel/Prewitt/Roberts/Laplace等都不懂。(很多搞图像处理的,只会标数据,然后用深度学习框架,我表示鄙视)

传统图像处理、深度学习图像处理,都是工具,掌握的方法越多,解决问题的能力越强。

当你手中只有一把锤子的时候,你往往会把一切的问题都看成钉子

发表评论
留言与评论(共有 0 条评论)
   
验证码:

相关文章

推荐文章

'); })();