I need to divide an image 512*512 into 41*41 overlapping using matlab.In other words, I want to take first a 41*41 block centred in q then I shift by a pixel and I take a 41*41 centered in q+1 and so on.. I can't use Blockproc because it gives a not overlapping block.
thanks to help me
解决方案
You CAN use BLOCKPROC. It is a bit non-obvious.
Set a block size of [1 1], and then use the 'Border' parameter to specify how big a block you want around each pixel:
>> a
a =
8 1 6
3 5 7
4 9 2
>> blockproc(a, [1 1], @(bs)disp(bs.data),'BorderSize', [1 1 ])
0 0 0
0 8 1
0 3 5
0 0 0
1 6 0
5 7 0
0 3 5
0 4 9
0 0 0
5 7 0
9 2 0
0 0 0
0 0 0
8 1 6
3 5 7
0 8 1
0 3 5
0 4 9
8 1 6
3 5 7
4 9 2
3 5 7
4 9 2
0 0 0
1 6 0
5 7 0
9 2 0