Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: dividing RGB Images
Replies: 9   Last Post: Jul 2, 2012 1:40 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Muhammad Imran

Posts: 61
Registered: 5/31/12
dividing RGB Images
Posted: Jul 1, 2012 5:00 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

I have an image of 256x384
i want to divide the image into 4x4 bloks can any one help me. i have code but this works for gray scale images.

[r c d] = size(I);
bs=4; % Block Size (4x4)
nob=(r/bs)*(c/bs); % Total number of 4x4 Blocks
nob
% Dividing the image into 4x4 Blocks
kk=0;


for i=1:(r/bs)
for j=1:(c/bs)


Block1(:,:,kk+j )=I((bs*(i-1)+1:bs*(i-1)+bs),(bs*(j-1)+1:bs*(j-1)+bs));
end
kk=kk+(r/bs);
end



this code works for grascle images but i have rgb or luv image
please help me



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2013. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.