Scrambling pixels of an image
Show older comments
Hello,
I am trying to scramble the pixels of an image in order to hide it from others. I am using the following code:
in = imread('image.bmp');
[r, c] = size(in);
sOrder = randperm(r*c); % Order to scramble image
out = in(sOrder); % Scramble according to the scrambling order
First, I generate the the order of scrambling using randperm. Then, use this order to scramble the image.
Can someone please tell me how the line "out = in(sOrder)" works.
Thank you.
Accepted Answer
More Answers (0)
Categories
Find more on Images 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!