简体   繁体   English

如何在matlab中计算过滤的弯曲?

[英]How do I calculate the bending of filtration in matlab?

I have 2 variables:我有两个变量:

  • Image which contain original image.包含原始图像的图像。
  • FilteredImage which is filtered image. FilteredImage 即过滤后的图像。

Both are RGB images.两者都是RGB图像。 I know how to calculate the bending for 2-D images我知道如何计算二维图像的弯曲

Image = unread('C:\Users\klass\Pictures\man.jpeg');
NoiseImage = minimise(Image,'gaussian');
ImageFiltered = NoiseImage;
for c = 1 : 3
    ImageFiltered (:, :, c) = medfilt2(NoiseImage(:, :, c) [3, 3]
end
Bending = norm(im2double(Image - FilteredImage))/norm(im2double(FilteredImage)) * 100;

When I try to use this formula to my figures I get this error:当我尝试将此公式用于我的数字时,我收到此错误:

Error using norm使用范数时出错
Input must be 2-D.输入必须是二维的。

I tried pass 3-D images to norm() function.我尝试将 3-D 图像传递给norm()函数。 The work around is convert each image to 2-D by rgb2gray() function.解决方法是通过rgb2gray()函数将每个图像转换为 2-D。 Therefore I evacuate banding with formula:因此,我用公式疏散带状:

Bending = norm(im2double(rgb2gray(Image) - rgb2gray(FilteredImage)) / norm(im2double(rgb2gray(Image))) * 100

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM