简体   繁体   中英

How do I calculate the bending of filtration in matlab?

I have 2 variables:

  • Image which contain original image.
  • FilteredImage which is filtered image.

Both are RGB images. 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. The work around is convert each image to 2-D by rgb2gray() function. Therefore I evacuate banding with formula:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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