本文介绍了如何在OpenCV中锐化图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何使用 OpenCV 来锐化图像?
有很多平滑或模糊的方法,但我看不到任何锐化的方法.
There are many ways of smoothing or blurring but none that I could see of sharpening.
推荐答案
您使用高斯平滑滤波器,并从原始图像中减去平滑版本(以加权方式,使恒定区域的值保持恒定).
You use a Gaussian smoothing filter and subtract the smoothed version from the original image (in a weighted way so the values of a constant area remain constant).
要将frame
的精简版本转换为image
:(均为cv::Mat
)
To get a sharpened version of frame
into image
: (both cv::Mat
)
cv::GaussianBlur(frame, image, cv::Size(0, 0), 3);
cv::addWeighted(frame, 1.5, image, -0.5, 0, image);
您需要自己调整一些参数.
The parameters there are something you need to adjust for yourself.
还有拉普拉斯锐化,您应该在Google上找到一些东西.
There's also Laplacian sharpening, you should find something on that when you google.
这篇关于如何在OpenCV中锐化图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!