how to traverse an image in 2x2 block wise wayand then check suitable conditions?
7 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
i am actually working for coloring a grayscale image.
2 commentaires
Jan
le 19 Juil 2011
Please ask one question only and edit it, if you want to add useful information.
Walter Roberson
le 19 Juil 2011
duplicate with more information is at http://www.mathworks.com/matlabcentral/answers/11904-how-to-divide-an-image-into-2x2-blocks-and-then-work-on-each-block-seperately-pixel-by-pixel
Réponse acceptée
Jan
le 19 Juil 2011
Img = rand(640, 480);
Img = reshape(X, 2, 320, 2, 240);
B = permute(Img, [1, 3, 2, 4]);
for i = 1:320
for j = 1:240
aBlock = B(:, :, i, j);
...
end
end
Img2 = ipermute(Block, [1, 3, 2, 4]);
Img2 = reshape(Img2, 640, 480);
Plus de réponses (2)
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!