| Image Processing Toolbox | ![]() |
Get block values in quadtree decomposition
Syntax
Description
[vals,r,c] = qtgetblk(I,S,dim) returns in vals an array containing the dim-by-dim blocks in the quadtree decomposition of I. S is the sparse matrix returned by qtdecomp; it contains the quadtree structure. vals is a dim-by-dim-by-k array, where k is the number of dim-by-dim blocks in the quadtree decomposition; if there are no blocks of the specified size, all outputs are returned as empty matrices. r and c are vectors containing the row and column coordinates of the upper-left corners of the blocks.
[vals,idx] = qtgetblk(I,S,dim) returns in idx a vector containing the linear indices of the upper-left corners of the blocks.
Class Support
I can be of class logical, uint8, uint16, or double. S is of class sparse.
Remarks
The ordering of the blocks in vals matches the columnwise order of the blocks in I. For example, if vals is 4-by-4-by-2, vals(:,:,1) contains the values from the first 4-by-4 block in I, and vals(:,:,2) contains the values from the second 4-by-4 block.
Example
This example continues the qtdecomp example.
[vals,r,c] = qtgetblk(I,S,4) vals(:,:,1) = 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1 1 vals(:,:,2) = 20 22 20 22 20 22 22 20 20 22 20 20 22 22 20 20 r = 1 5 c = 1 1
See Also
| qtdecomp | qtsetblk | ![]() |