im2col
Rearrange image blocks into columns
Description
Examples
Input Arguments
Output Arguments
Tips
For distinct block processing,
im2col
zero-padsA
, if necessary, so its size is an integer multiple ofm
-by-n
. The padding value is0
whenA
is data typeuint8
,uint16
, orlogical
. For other data types, the value of padding depends on whetherA
is interpreted as an indexed image.The padding value is
1
whenA
is interpreted as an indexed image.The padding value is
0
whenA
is not interpreted as an indexed image.
im2col
orders the columns ofB
so 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