Split an image into two sets
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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.
0 comentarios
Respuestas (1)
Matt J
el 27 de Oct. de 2019
N=numel(yourImage);
indices=randperm(N,round(N/2));
A=yourImage(indices);
B=yourImage; B(indices)=[];
1 comentario
Ver también
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!