pixel scrambling of image
3 views (last 30 days)
Show older comments
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);
0 Comments
Answers (0)
See Also
Categories
Find more on Image Processing Toolbox 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!