generating matrix randomly
古いコメントを表示
I have an matrix of an image ,face.jpg,now i want to interchange the pixel values,position of values must be changed( randomly),,please help
採用された回答
その他の回答 (1 件)
Junaid
2012 年 1 月 3 日
There are many ways to do it. One possible way is.
myface = imread('myface.jpg');
myRan = randperm(prod(size(myface))); % we assume myface.jpg is grayscale
myRan=reshape(myRan,size(myface));
myface(myRan) = myface;
These four lines can be done in one line. Just to show you the steps i followed this into four lines.
7 件のコメント
kash
2012 年 1 月 3 日
kash
2012 年 1 月 3 日
Walter Roberson
2012 年 1 月 3 日
You would need to know the myRan permutation vector in order to reverse the transformation. This is known as the Key Exchange Problem, http://en.wikipedia.org/wiki/Key_exchange#The_key_exchange_problem
kash
2012 年 1 月 3 日
Walter Roberson
2012 年 1 月 3 日
I am having trouble figuring out what you are trying to do, sorry.
kash
2012 年 1 月 3 日
Walter Roberson
2012 年 1 月 3 日
I wouldn't expect any of them to have good clarity compared with the original image.
カテゴリ
ヘルプ センター および File Exchange で Logical についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!