pixel scrambling of image

조회 수: 2 (최근 30일)
Urmila
Urmila 2014년 3월 13일
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개)

카테고리

Help CenterFile Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by