im2col
Rearrange image blocks into columns
Description
Examples
Input Arguments
Output Arguments
Tips
For distinct block processing,
im2colzero-padsA, if necessary, so its size is an integer multiple ofm-by-n. The padding value is0whenAis data typeuint8,uint16, orlogical. For other data types, the value of padding depends on whetherAis interpreted as an indexed image.The padding value is
1whenAis interpreted as an indexed image.The padding value is
0whenAis not interpreted as an indexed image.
im2colorders the columns ofBso that they can be reshaped to form a matrix according toreshape.For example, suppose you use a function, such as
sum(B), that returns a scalar for each column ofB. You can directly store the result in a matrix of size (mm-m+1)-by-(nn-n+1), using these calls.B = im2col(A,[m n],"sliding"); C = reshape(sum(B),mm-m+1,nn-n+1);
Version History
Introduced before R2006a