how do i use the rand command in an array of an image, i want the program to read the image and draw some elements from that array
1 次查看(过去 30 天)
显示 更早的评论
Como uso o comando rand em uma matriz de uma imagem? Quero que o programa leia a imagem e desenhe alguns elementos dessa matriz.
2 个评论
回答(2 个)
Image Analyst
2019-10-13
Try something like this:
randomIndexes = randperm(numel(grayImage), numIndexes);
extractedPixels = grayImage(randomIndexes);
where grayImage is your grayscale image, and numIndexes is the number of pixels you want to extract from the full image.
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!