Matlab中的图像混洗反向误差

时间:2018-06-12 05:13:57

标签: matlab image-processing shuffle

我在灰度图像上使用Henon贴图实现了图像改组技术。图像的改组与我合作。但是,当我将其重新打印回原始图像时,我得到了一张图像,其中黑色像素散布在恢复的图像周围。 请参阅附图的结果以及matlab代码。

enter image description here

clear all
clc
g=imread('cameraman.tif');
original=g;
[m,n]=size(g);
%g = imresize(g, [255 255]);
g=g(:,:,1);
subplot(2,2,1)
imshow(g,[])
title('Original Image')
   %HENON SHUFFLING
    [m,n]=size(g);
     a = 3;
     b = 3;
    num_iter = 5;
     for k=1:num_iter
    for i=1:m
        for j=1:n
            r = mod([round(abs(1-(a*(i^2))+j)),round(abs(b*i))],[m n]);
             x(i,j)=g(r(1)+1,r(2)+1);
         end
     end
      g=x;
     end
     subplot(2,2,2)
     imshow(x,[]);
     title('Henon Shuffled Image')
     %HENON INVERSE SHUFFLING
     [m,n]=size(x);
     a = 3;
     b = 3;
    num_iter = 5;
     for k=1:num_iter
    for i=1:m
        for j=1:n
    r1 = mod([round(abs(1-(a*(i^2))+j)),round(abs(b*i))],[m n]);
    x1(r1(1)+1,r1(2)+1)=x(i,j);
    %x(i,j)=x1(r(1)+1,r(2)+1);
         end
     end
      x=x1;
     end
     subplot(2,2,3)
     imshow(x1,[]);
     title('Henon Inverse Shuffled')   
     set(gcf,'units','normalized','outerposition',[0 0 1 1]);

0 个答案:

没有答案