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 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Ajay Kumar
am 12 Okt. 2019
what is the size of image? and what size do you want in the output matrix?
Antworten (2)
Image Analyst
am 13 Okt. 2019
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 Kommentare
Siehe auch
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!