フィルターのクリア

Why i didnt get the image back during decryption using this inverse code ?

2 ビュー (過去 30 日間)
Sneha P S
Sneha P S 2018 年 3 月 8 日
回答済み: Image Analyst 2018 年 3 月 9 日
I used the below code for image scrambling and unscrambling. But i didnt get the exact image in unscrambling. In the decrypted image the upper portion is at the bottom position, that is the hat in the lena image comes at bottom. Please help me to rectify it.
ite=1;
[rown,coln]=size(im);
for i=1:rown
for j=1:coln
itecount=1;
nrowp=i;
ncolp=j;
while(itecount<=ite)
newcord =[1 1;1 2]*[nrowp ncolp]';
nrowp=newcord(1);
ncolp=newcord(2);
itecount=itecount+1;
end
encim(i,j)=im((mod(nrowp,rown)+1),(mod(ncolp,coln)+1));
end
end
%INVERSE
figure,imshow(im)
impixelinfo
figure,imshow(uint8(encim))
impixelinfo
[rown,coln]=size(encim)
for i=1:rown
for j=1:coln
itecount=1;
nrowp=i;
ncolp=j;
while(itecount<=ite)
newcord =[2 -1;-1 1]*[nrowp-1 ncolp-1]';
nrowp=newcord(1);
ncolp=newcord(2);
itecount=itecount+1;
end
decim(i,j)=encim((mod(nrowp,rown)+1),(mod(ncolp,coln)+1));
end
end
figure,imshow(uint8(decim))
impixelinfo
  4 件のコメント
Jan
Jan 2018 年 3 月 8 日
@Sneha P S: There is no need to be sorry. But let me mention, that your code is still not formatted properly. Now there is a blank line after each line of code, some parts are recognized as code (due to the leading spaces), but some are not. Please read: Tutorial: How to format text in the forum.
Sneha P S
Sneha P S 2018 年 3 月 9 日
I had done the changes.

サインインしてコメントする。

回答 (1 件)

Image Analyst
Image Analyst 2018 年 3 月 9 日
I'm not sure what this uncommented code does. Is it the Arnold cat map? Just regular scrambling? I'm attaching demos for both. Since I don't know what your image does (due to lack of comments/explanations), I don't know how to fix it.

カテゴリ

Help Center および File ExchangeRead, Write, and Modify Image についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by