how to make a face image scramble by matlab?
Show older comments
I want to scramble a grayscale image and actually I want to have patches or square blocks and scramble by them. But before that I have to mask my image by an oval then scramble the part of image that is inside of oval, for this reason I have to make vertical and horizental strips in that oval and scramble them. Also I prefer to have ability to change size of this strips. Would you please help me by that?
I have this image:
(mary.BW)and I mask it by oval by this code:
----------------------------------------
clear all Baselum=0; Radius=342;
X=206 Y1=78; Y2=323;
for c=1
I=imread(['C:\Users\User\Desktop\oval mask\attached image.jpg']);
for i=1:400
for j=1:400
ovaldistance=(sqrt((X-i)^2 + (Y1-j)^2)+sqrt((X-i)^2 + (Y2-j)^2));
if ovaldistance > Radius
I(j,i,:)=Baselum;
end;
end;
end;
imwrite(I,['OvalMask1','attached image.jpg']);
end;
----------------------------------------
and the result will be like this:
(oval mask.jpg)
and now I want to scramble part of image that is in the oval. I have to make strips and flip them in order to make the image scrambled. But I don't know the right matlab function to do it. Please Help me. The result must be something like the third attached image:
Pleaaaaaasee help meeeeeeee
Accepted Answer
More Answers (0)
Categories
Find more on Ground Truth Labeling in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!