如何在OpenCV中锐化图像? [英] How to sharpen an image in OpenCV?
问题描述
如何使用 OpenCV 锐化图像?有许多平滑或模糊的方法,但没有我能看到的锐化。
How to sharpen an image using OpenCV? There are many ways of smoothing or blurring but none that I could see of sharpening.
推荐答案
一个通用程序在< a href =http://en.wikipedia.org/wiki/Unsharp_masking#Digital_unsharp_masking =noreferrer>关于反锐化掩蔽的维基百科文章:
您使用高斯平滑滤波器并减去来自原始图像的平滑版本(以加权方式使得常量区域的值保持不变)。
One general procedure is laid out in the wikipedia article on unsharp masking: 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).
获得框架的锐化版本
进入图像
:(两个 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.
还有laplacian锐化,你应该在google上找到一些东西。
There's also laplacian sharpening, you should find something on that when you google.
这篇关于如何在OpenCV中锐化图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!