如何在OpenCV中锐化图像 [英] How To Sharpen an image in OpenCV

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

问题描述

基本的Google搜索会找到这个问题以及出现的内容是一个很好的答案。然而,当我尝试时,它对锐化我模糊的图像没有任何影响。

A basic Google search finds this SO question and what appears to be an excellent answer. When I try, however, it has absolutely no effect on sharpening my blurred image.

有人可以澄清我是否做了完全错误的事情吗?

Could somebody clarify if I'm doing something completely wrong?

到目前为止我所做的是在图像上实现filter2D功能以消除随机噪声,它也模糊了我的周期性噪声,这是非常好的。现在我已经模糊了噪点,我想要锐化图像以查看比原始图像更低噪声的图像。这是我的代码: -

What I've done so far is implement the filter2D function on an image to remove random noise, it also blurs my periodic noise, which is excellent. Now that I've blurred out the noise, I want to sharpen the image to see a less-noisy image than the original image. Here's my code:-

   anchor = Point( -1, -1 );
   delta = 0;
   ddepth = -1;
   dst = frame;
   dst2 = image;

  filter2D(src, dst, ddepth , kernel, anchor, delta, BORDER_DEFAULT );

  cv::GaussianBlur(frame, image, cv::Size(0, 0), 11);
  cv::addWeighted(frame, 1.5, image, -0.5, 0, image);

gaussianblur和addWeighted对图像产生 NO 差异。此外,澄清一下,根本没有代码错误。

The gaussianblur and addWeighted make NO difference to the image whatsoever. Also, to clarify, there are no code errors at all either.

推荐答案

对于未来的读者,代码确实有效只是我的图像太模糊了,上面的代码没有明显的效果!

For future readers, the code does work it was just that my image was so blurry, the above code had no visible effect!

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

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