如何在 OpenCV 中锐化图像? [英] How can I sharpen an image in OpenCV?

查看:38
本文介绍了如何在 OpenCV 中锐化图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用 OpenCV 锐化图像?

How can I sharpen an image using 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: (both 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.

还有拉普拉斯锐化,你应该在谷歌时找到一些东西.

There's also Laplacian sharpening, you should find something on that when you google.

这篇关于如何在 OpenCV 中锐化图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆