How to handle the output of 4x4 blockproc for calculating zigzag of a matrix in Matlab?

조회 수: 1 (최근 30일)
Hi, I have the following matrix as input of 4x4 blocproc in matlab:
imgTest2 = ...
[1 2 3 4 5 6 7 8;
1 2 3 4 5 6 7 8;
1 2 3 4 5 6 7 8;
1 2 3 4 5 6 7 8;]
Now I have used blockproc as below:
%Block Processing for getting the zigzag of the imgTest2 matrix
fun2 = @(block_struct) ...
zigzag2(block_struct.data);
zz2 = blockproc(imgTest2,[4 4],fun2);
The zigzag2 function is used to get the zigzag of each 4x4 block of the input array.
Now, the problem is, I want each 4x4 block's zigzag into different rows of zz2 vector. But unfortunately, if I run it, zz2 becomes 1x32. I want 16 value (from each block, zigzagged) from each block in different rows.
This is just a sample data. I will run this on a higher resolution image and want each block's zigzag in different rows.
Looking forward for your kind suggestion.
Thank you.

답변 (0개)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by