Hi i would like to know how to divide a pixel into subpixels and then randomly assign 0 and 1 to the subpixels
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Serena Woolridge
le 31 Mar 2016
Commenté : Serena Woolridge
le 1 Avr 2016
Iv got an image and i hv to divide its pixels into subpixels in a matrix form and then randomly assign 0 and 1 to its rows and columns.
0 commentaires
Réponse acceptée
Image Analyst
le 31 Mar 2016
Modifié(e) : Image Analyst
le 31 Mar 2016
subpixels = randi(1, rows, columns);
where rows and columns are some number more than the rows and columns of the original image. For example
[originalRows, originalColumns, numColors] = size(grayImage);
rows = 2 * originalRows;
columns = 2 * originalColumns;
subpixelImage = randi(1, rows, columns);
Now each pixel will be "occupied" by 4 pixels of the higher resolution subpixelImage.
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Read, Write, and Modify Image dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!