Calculate block best size for block processing.
Given a matrix of size IMS, calculates the largest size for distinct blocks blk_size, that minimize padding and is smaller than or equal to k (defaults to 100)
The output blk_size is a row vector for the block size. If there are multiple output arguments, the number of rows is assigned to the first (Mb), and the number of columns to the second (Nb), etc.
To determine blk_size, the following is performed for each dimension:
min (dimension/10, k/2)
which minimizes padding.
See also: blockproc, col2im, im2col.
The following code
siz = bestblk ([200; 10], 50); disp (siz)
Produces the following output
50 10
Package: image