annotate DL/RLS-DLA/private/im2colstep.m @ 60:ad36f80e2ccf

(none)
author idamnjanovic
date Tue, 15 Mar 2011 12:20:59 +0000
parents
children
rev   line source
idamnjanovic@60 1 %IM2COLSTEP Rearrange matrix blocks into columns.
idamnjanovic@60 2 % B = IM2COLSTEP(A,[N1 N2]) converts each sliding N1-by-N2 block of the
idamnjanovic@60 3 % 2-D matrix A into a column of B, with no zero padding. B has N1*N2 rows
idamnjanovic@60 4 % and will contain as many columns as there are N1-by-N2 neighborhoods in
idamnjanovic@60 5 % A. Each column of B contains a neighborhood of A reshaped as NHOOD(:),
idamnjanovic@60 6 % where NHOOD is a matrix containing an N1-by-N2 neighborhood of A.
idamnjanovic@60 7 %
idamnjanovic@60 8 % B = IM2COLSTEP(A,[N1 N2],[S1 S2]) extracts neighborhoods of A with a
idamnjanovic@60 9 % step size of (S1,S2) between them. The first extracted neighborhood is
idamnjanovic@60 10 % A(1:N1,1:N2), and the rest are of the form A((1:N1)+i*S1,(1:N2)+j*S2).
idamnjanovic@60 11 % Note that to ensure coverage of all A by neighborhoods,
idamnjanovic@60 12 % (size(A,i)-Ni)/Si must be whole for i=1,2. The default function behavior
idamnjanovic@60 13 % corresponds to [S1 S2] = [1 1]. Setting S1>=N1 and S2>=N2 results in no
idamnjanovic@60 14 % overlap between the neighborhoods.
idamnjanovic@60 15 %
idamnjanovic@60 16 % B = IM2COLSTEP(A,[N1 N2 N3],[S1 S2 S3]) operates on a 3-D matrix A. The
idamnjanovic@60 17 % step size [S1 S2 S3] may be ommitted, and defaults to [1 1 1].
idamnjanovic@60 18 %
idamnjanovic@60 19 % Note: the call IM2COLSTEP(A,[N1 N2]) produces the same output as
idamnjanovic@60 20 % Matlab's IM2COL(A,[N1 N2],'sliding'). However, it is significantly
idamnjanovic@60 21 % faster.
idamnjanovic@60 22 %
idamnjanovic@60 23 % See also COL2IMSTEP, IM2COL, COUNTCOVER.
idamnjanovic@60 24
idamnjanovic@60 25
idamnjanovic@60 26 % Ron Rubinstein
idamnjanovic@60 27 % Computer Science Department
idamnjanovic@60 28 % Technion, Haifa 32000 Israel
idamnjanovic@60 29 % ronrubin@cs
idamnjanovic@60 30 %
idamnjanovic@60 31 % August 2009