how to traverse an image in 2x2 block wise wayand then check suitable conditions?
7 次查看(过去 30 天)
显示 更早的评论
i am actually working for coloring a grayscale image.
2 个评论
Walter Roberson
2011-7-19
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
采纳的回答
Jan
2011-7-19
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);
更多回答(2 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!