I have some pixels with value more than 1 , I want to find randomly from those pixels. I tried this command : randi(size(imfinal),1,5) but it gives me random number of pixel number. I want exactly the number of i , j of the pixel,and those pixel which their value is more than 1 .
How can I find random pixels in an image?
5 ビュー (過去 30 日間)
古いコメントを表示
Hi all, I have a 256*256 pixels image and I want to have 5 randomly pixels in it.how can I do that?
採用された回答
Faranak
2014 年 2 月 13 日
1 件のコメント
Image Analyst
2014 年 2 月 13 日
That does not do what you asked. The first loop merely assigns the entire image to f. The second part looks at only the first 1800 pixels with a value of more than 20 and picks the linear index of 5 of them.
It doesn't give you "number of i , j of the pixel" and doesn't look at "those pixel which their value is more than 1". But whatever...as long as you're happy.
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!