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
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
arwa allubani
am 10 Okt. 2020
Kommentiert: arwa allubani
am 6 Nov. 2020
W_log=imread('lena_g.bmp');
Key1=100;
s = size(W_log);
ss=rng(Key1,'twister'); % you need to initiate this code every time before scrambling
p = reshape(randperm(numel(W_log)),s);
SW_log = W_log(p);% scrambled logo figure,
imshow(W_log);
figure, imshow(SW_log);
0 Kommentare
Akzeptierte Antwort
Subhadeep Koley
am 3 Nov. 2020
Hi Arwa, below code might help.
W_log = imread('cameraman.tif');
Key1 = 100;
s = size(W_log);
ss = rng(Key1, 'twister'); % you need to initiate this code every time before scrambling
p = reshape(randperm(numel(W_log)), s);
SW_log = W_log(p);% scrambled logo figure,
imshow(W_log)
title('Original image')
figure
imshow(SW_log)
title('Scrambled image')
% Reconstruction process
original_matrix(p) = SW_log;
original_matrix = reshape(original_matrix, s);
figure
imshow(original_matrix)
title('Reconstructed image')
Weitere Antworten (0)
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!