how to traverse an image in 2x2 block wise wayand then check suitable conditions?
7 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
i am actually working for coloring a grayscale image.
2 Commenti
Walter Roberson
il 19 Lug 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
Risposta accettata
Jan
il 19 Lug 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);
Più risposte (2)
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!