This is machine translation

Translated by Microsoft
Mouse over text to see original. Click the button below to return to the English verison of the page.


Determine optimal block size for block processing


siz = bestblk([m n],k)
[mb,nb] = bestblk([m n],k)


siz = bestblk([m n],k) returns, for an m-by-n image, the optimal block size for block processing. The optimal block size is the size required along the outer partial blocks. k is a scalar specifying the maximum row and column dimensions for the block. If you omit this argument, the default is 100. The return value siz is a 1-by-2 vector containing the row and column dimensions for the block.

[mb,nb] = bestblk([m n],k) returns the row and column dimensions for the block in mb and nb, respectively.


collapse all

siz = bestblk([640 800],72)
siz =

    64    50

More About

collapse all


bestblk returns the optimal block size given m, n, and k. The algorithm for determining siz is

  • If m is less than or equal to k, return m.

  • If m is greater than k, consider all values between min(m/10,k/2) and k. Return the value that minimizes the padding required.

The same algorithm is then repeated for n.

See Also

Introduced before R2006a

Was this topic helpful?