Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

dividing color image into nxn non overlapping blocks

532 views
Skip to first unread message

Sathish Kumar

unread,
Jan 28, 2011, 3:40:03 AM1/28/11
to
hi
i want to divide colour image of size 411x405 into nxn non overlapping blocks and then for each block i have to extract eigen vectors using principle compond analysis.plz help me to write the code in matlab.

raji

Shanmugam Kannappan

unread,
Jan 28, 2011, 4:41:03 AM1/28/11
to
"Sathish Kumar" wrote in message <ihtvd3$6be$1...@fred.mathworks.com>...

> hi
> i want to divide colour image of size 411x405 into nxn non overlapping blocks and then for each block i have to extract eigen vectors using principle compond analysis.plz help me to write the code in matlab.
>
> raji

Hi!

try help blkproc

HTH
Shan!

ImageAnalyst

unread,
Jan 28, 2011, 2:22:35 PM1/28/11
to

----------------------------------------------------------------
See the 3 examples at the bottom of this page:
http://www.mathworks.com/help/toolbox/images/exampleindex.html

Sathish Kumar

unread,
Jan 30, 2011, 12:12:03 AM1/30/11
to
hi
i had ask about dividing a color image into nxn non overlapping sub blocks and i have to extract eigen vectors for each sub blocks using principle compond analysis when i use blockproc function its throwing error as
d=blockproc(c,[2 2],eig)
??? Error using ==> eig
Not enough input arguments.
i don know how to proceed
help me..........

Sathish Kumar

unread,
Jan 30, 2011, 12:54:03 AM1/30/11
to
hi
iam doing project based on image processing .the concept is to take two satellite image that is taken at two different years in same site (area)and to find the changes take place .
for that first a difference image is created by subtract the two input image that i have done.
next is to divide tat difference image into nXn non over lapping blocks
then to find eigen vectors using principle compound analysis for each block
then k mean clustering is used to find change map
tats my task now i dont know how to divide tat difference image into non overlapping nxn blocks what will be the size of each block my input have size as
r=411
c=1215
if i use blockproc fun its showing error

d=blockproc(c,[2 2],eig)
??? Error using ==> eig
Not enough input arguments.
plz help me as i feel difficult to work with matlab

Think blue, count two.

unread,
Jan 30, 2011, 1:31:26 AM1/30/11
to

That syntax calls eig with no arguments, hopes to come up with a result,
and then pass that result as the third parameter to blockproc.

Perhaps you wanted

d = blockproc(c, [2 2], @eig)

Brendan Hannigan

unread,
Jan 31, 2011, 9:58:04 AM1/31/11
to
"Think blue, count two." <robe...@hushmail.com> wrote in message <4B71p.68375$7p5....@newsfe21.iad>...

try:

d = blkproc(c,[5 5],@eig);

your result will be a single complex matrix containing all of the results from each block in a single matrix.

srujanangg

unread,
May 30, 2012, 9:50:49 PM5/30/12
to
Hi
By using blkproc command in matlab ,you can divide the image into number of nonoverlaping blocks.

B = blkproc(A,[m n],fun) processes the image A by applying the function fun to each distinct m-by-n block of A, padding A with 0's if necessary. fun is a function handle that accepts an m-by-n matrix, x, and returns a matrix, vector, or scalar y.

y = fun(x)

blkproc does not require that y be the same size as x. However, B is the same size as A only if y is the same size as x.

B = blkproc(A,[m n],[mborder nborder],fun) defines an overlapping border around the blocks. blkproc extends the original m-by-n blocks by mborder on the top and bottom, and nborder on the left and right, resulting in blocks of size (m+2*mborder)-by-(n+2*nborder). The blkproc function pads the border with 0's, if necessary, on the edges of A. The function fun should operate on the extended block.

The line below processes an image matrix as 4-by-6 blocks, each having a row border of 2 and a column border of 3. Because each 4-by-6 block has this 2-by-3 border, fun actually operates on blocks of size 8-by-12.

B = blkproc(A,[4 6],[2 3],fun)

B = blkproc(A,'indexed',...) processes A as an indexed image, padding with 0's if the class of A is uint8 or uint16, or 1's if the class of A is double.


0 new messages