reconstructing the original image from shuffled image

Hi all
I performed shuffling on image pixels like
shuffled_image=reshape(img(randperm(numel(img))),size(img));
In this way, I got the image whose pixels location are shuffled randomly.How can I get or reconstruct the original image (img) from the shuffled image.Every help is appreciated

 採用された回答

Matt J
Matt J 2014 年 5 月 7 日
編集済み: Matt J 2014 年 5 月 7 日

1 投票

I'm assuming you saved the permutation indices, idx, as below
idx=randperm(numel(img));
shuffled_image=reshape(img(idx),size(img))
Then you can do,
iidx(idx)=1:numel(img);
recovered_image=reshape(shuffled_image(iidx),size(img))

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeImages についてさらに検索

質問済み:

2014 年 5 月 7 日

編集済み:

2014 年 5 月 7 日

Community Treasure Hunt

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

Start Hunting!

Translated by