pixel scrambling of image

1 view (last 30 days)
Urmila
Urmila on 13 Mar 2014
I have done image scrambling by exchanging pixels using following method: 1. pn sequence is generated 2.For every bit value 1 in the PN sequence, the corresponding index in the image is exchanged with its diagonal counterpart using equation I(i,j)=p*I(j,i)+p′ * I (i, j) , Otherwise the image pixel is kept same. now i want to reverse the process and want to unscrambled the image to obtain original image. but not getting how to do it? plz help me. here is part of code:
clc;
clear all;
close all;
originalImage=imread('cameraman.tif')
I=mat2gray(originalImage);
figure;
imshow(I);
[m n c]=size(I);
myseed=0;
rng(myseed); % rng seeds the random number generator
seq1 = round(rand(size(I)));
for i=1:m
for j=1:n
s= seq1(i,j)
if s==1
k=~s
I(i,j)=(s*I(j,i))+(k*I(i,j));
end
end
end
figure,imshow(I);

Answers (0)

Categories

Find more on Images in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!