Split an image into two sets
Afficher commentaires plus anciens
Hi, I need to split an image into two sets of pixels A and B, each randomly containing half of the pixels (using the rand function). Thanks in advance for any help.
Réponses (1)
Matt J
le 27 Oct 2019
N=numel(yourImage);
indices=randperm(N,round(N/2));
A=yourImage(indices);
B=yourImage; B(indices)=[];
Catégories
En savoir plus sur Image Processing Toolbox dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!