找到噪声图像边缘的最佳方法 [英] Best method to find edge of noise image

查看:121
本文介绍了找到噪声图像边缘的最佳方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个噪音图像我,如波纹图。假设它是高斯噪声。
目前,我使用两个步骤来查找边缘


  1. 使用高斯滤镜G平滑图像

  2. 根据等式求边缘



    g = 1 /(1 +β∇(I * G)^ 2)


其中G是高斯滤波器。 β是控制噪音水平的重量。



然而,高斯滤波器是图像边缘丢失的原因。我想找到一个更好的方法来保存边缘信息。您能否向我推荐找到该图像边缘的最佳方法?



这是我上述步骤的结果





以下是我正在处理的添加了噪音的图片:





为了获得优势,这是我写的MATLAB代码:

  beta = 0.01; 
G = fspecial('gaussian',[3 3],1);
I_G = conv2(I,G,'相同');
[Gx,Gy] =梯度(I_G);
NormGrad = sqrt(Gx。^ 2 + Gy。^ 2);
g = 1. /(1 + beta * NormGrad。^ 2);
imshow(g,[]);


解决方案

Canonical



一旦我们有了这个,请尝试使用任何规范的边缘检测器来检测边缘。你正在使用的那个预先模糊图像,然后找到边缘,但是使用标准平滑,它会错过一些边缘。因为使用Guided图像滤镜可以使我们保持边缘并且整个图像基本上没有噪声,所以我们可以在边缘平滑结果上尝试像Sobel滤镜一样简单:

  [Gmag,〜] = imgradient(q,'sobel'); 
imshow(max(Gmag(:)) - Gmag,[]);

以上代码使用



正如您所看到的,即使存在噪音,我们仍然能够敲定很多边缘。


I have a noise image I such as the bellow figure. Assume that it is Gaussian noise. Currently, I am using two steps to find the edge

  1. Smooth the image using Gaussian filter G
  2. Find edge based on the equation

    g=1/(1+β∇ (I*G)^2)

where G is gaussian filter. β is weight to control the noise level.

However, the Gaussian filter is reason for losing of edge in image. I want to find a better method that can preserve edge information. Could you suggest to me the best method to find the edge of that image?

This is my result for above steps

Here's the image I am working on with the noise added:

To get the edges, this is the MATLAB code I wrote:

beta=0.01;
G = fspecial('gaussian',[3 3],1);
I_G = conv2(I,G,'same');
[Gx,Gy] = gradient(I_G);
NormGrad = sqrt(Gx.^2 + Gy.^2); 
g = 1./ (1 + beta* NormGrad.^2);
imshow(g,[]);

解决方案

Canonical edge-preserving smoothing filters should be quite adequate for your particular application. These simultaneously remove noise (Gaussian distributed I should add...) while maintaining edges as best as possible. Classic examples include the bilateral filter, the Guided image filter by Kaiming He, Domain Transform filtering by Gastal and Oliveira (which I have successfully used in the past) and even anisotropic diffusion.

To try something quickly, the Guided image filter is now included as an official function that's part of the image processing toolbox since MATLAB R2014a via the imguidedfilter function. If you don't have MATLAB R2014a or up, then you can download the raw MATLAB source of the code via this link here: http://kaiminghe.com/eccv10/guided-filter-code-v1.rar, but you can get this from the main website I linked to you above.

Assuming you don't have R2014a, download the Guided image filter code and let's use it to filter your example. Given your link to the example image that was corrupted with noise, I downloaded it and am using it in the code below:

I = im2double(imread('http://i.stack.imgur.com/ACRE8.png')); %// Load in sample image that was corrupted by noise
r = 2; %// Parameters for the Guided image filter
eps = 0.1^2;

%// Filter the image, using itself as a guide
q = guidedfilter(I, I, r, eps);

%// Show the original image and the filtered result
figure;
subplot(1,2,1); imshow(I, []);
subplot(1,2,2); imshow(q, []);

We show the original image, then the guided filter result on the right:

Once we have that, try using any canonical edge detector to detect the edges. The one you're using pre-blurs the image before finding the edges, but that uses standard smoothing and it will miss out on some edges. Because using the Guided image filter brings us to a point where the edges are maintained and the overall image is essentially noise free, we can try something simple like a Sobel filter on the edge smoothed result:

[Gmag,~] = imgradient(q, 'sobel');
imshow(max(Gmag(:)) - Gmag,[]);

The above code uses imgradient to find image gradients and then we show the image by inverting the intensities so that the black values become white and white become black as seen in your example.

... and we get this:

As you can see, even with the presence of noise, we still were able to hammer out a lot of the edges.

这篇关于找到噪声图像边缘的最佳方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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