ヘルプ センターヘルプ センター
行列の列をブロックに再配置
A = col2im(B,[m n],[M N])
A = col2im(B,[m n],[M N],'sliding')
A = col2im(B,[m n],[M N],'distinct')
A = col2im(B,[m n],[M N]) または
A
B
[m n]
[M N]
A = col2im(B,[m n],[M N],'sliding') は行ベクトル B を m 行 n 列の近傍に再配置することで、サイズが (M-m+1) 行 (N-n+1) 列の行列 A を作成します。
m
n
(M-m+1)
(N-n+1)
行ベクトル B は通常 im2col(...,'sliding') の出力を、sum などの列圧縮関数を使用して、処理した結果です。
im2col(...,'sliding')
sum
例
A = col2im(B,[m n],[M N],'distinct') は行列 B の各列を m 行 n 列の明確に区別されたブロックに再配置することで、サイズが M 行 N 列の行列 A を作成します。
M
N
たとえば、B の構成が、列ベクトル Bi(:) で長さ m*n であり、B = [B1(:) B2(:) B3(:) B4(:)] という配置の場合、A = [B1 B3; B2 B4] で各ブロック Bi は m 行 n 列になります。
Bi(:)
m*n
B = [B1(:) B2(:) B3(:) B4(:)]
A = [B1 B3; B2 B4]
Bi
すべて折りたたむ
行列を作成します。
B = reshape(uint8(1:25),[5 5])'
B = 5x5 uint8 matrix 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
行列内の値を列方向の配置に再配置します。
C = im2col(B,[1 5])
C = 5x5 uint8 matrix 1 6 11 16 21 2 7 12 17 22 3 8 13 18 23 4 9 14 19 24 5 10 15 20 25
行列内の値を元の行方向の配置に戻します。
A = col2im(C,[1 5],[5 5],'distinct')
A = 5x5 uint8 matrix 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
イメージ ブロック。次のいずれかに指定します。
個別ブロック処理では、B は m*n 行の数値または logical 行列です。各列は 1 つのブロックに対応します。
スライディング近傍処理では、B は 1 行 (M-m+1)*(N-n+1) 列の数値または logical 行ベクトルです。
(M-m+1)*(N-n+1)
データ型: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64 | logical
single
double
int8
int16
int32
int64
uint8
uint16
uint32
uint64
logical
ブロック サイズ。正の整数の 2 要素ベクトルとして指定します。m は各ブロックの行数で、n は列数です。m*n は B の行数に等しくなければなりません。
データ型: double
イメージのサイズ。正の整数の 2 要素ベクトルとして指定します。ここで、M はイメージの行数で、N は列数です。
再構成イメージ。個別ブロック処理では M 行 N 列の数値行列として、スライディング ブロック処理では (M-m+1) 行 (N-n+1) 列として返されます。A は B と同じデータ型です。
R2006a より前に導入
blockproc | colfilt | im2col | nlfilter | reshape
blockproc
colfilt
im2col
nlfilter
reshape
この例の変更されたバージョンがあります。編集された方の例を開きますか?
次の MATLAB コマンドに対応するリンクがクリックされました。
コマンドを MATLAB コマンド ウィンドウに入力して実行してください。Web ブラウザーは MATLAB コマンドをサポートしていません。
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office