Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
2024.1.0 - 日本語


convol2d

離散 2-D 畳み込み, fftを使用.

呼び出し手順

C = convol2d(A,B)

パラメータ

A

実数または複素数二次元配列.

B

実数または複素数二次元配列.

C

実数または複素数二次元配列.

説明

convol2d は 完全な二次元離散畳み込みを計算するためにfftを使用します. 結果 C の次元は size(A)+size(B)-1で指定されます. Bの中心要素の添字は floor((size(B)+1)/2)で定義されます.

s = [1 2 1; 0 0 0; -1 -2 -1] // Sobel horizontal edge kernel
A = zeros(10,10); A(3:7,3:7) = 1
C = convol2d(s, A);
clean(C)
--> s = [1 2 1; 0 0 0; -1 -2 -1] // Sobel horizontal edge kernel
 s  =
   1.   2.   1.
   0.   0.   0.
  -1.  -2.  -1.

--> A = zeros(10,10); A(3:7,3:7) = 1
 A  =
   0.   0.   0.   0.   0.   0.   0.   0.   0.   0.
   0.   0.   0.   0.   0.   0.   0.   0.   0.   0.
   0.   0.   1.   1.   1.   1.   1.   0.   0.   0.
   0.   0.   1.   1.   1.   1.   1.   0.   0.   0.
   0.   0.   1.   1.   1.   1.   1.   0.   0.   0.
   0.   0.   1.   1.   1.   1.   1.   0.   0.   0.
   0.   0.   1.   1.   1.   1.   1.   0.   0.   0.
   0.   0.   0.   0.   0.   0.   0.   0.   0.   0.
   0.   0.   0.   0.   0.   0.   0.   0.   0.   0.
   0.   0.   0.   0.   0.   0.   0.   0.   0.   0.

--> C = convol2d(s, A);
--> clean(C)
 ans  =
   0.   0.   0.   0.   0.   0.   0.   0.   0.   0.   0.   0.
   0.   0.   0.   0.   0.   0.   0.   0.   0.   0.   0.   0.
   0.   0.   1.   3.   4.   4.   4.   3.   1.   0.   0.   0.
   0.   0.   1.   3.   4.   4.   4.   3.   1.   0.   0.   0.
   0.   0.   0.   0.   0.   0.   0.   0.   0.   0.   0.   0.
   0.   0.   0.   0.   0.   0.   0.   0.   0.   0.   0.   0.
   0.   0.   0.   0.   0.   0.   0.   0.   0.   0.   0.   0.
   0.   0.  -1.  -3.  -4.  -4.  -4.  -3.  -1.   0.   0.   0.
   0.   0.  -1.  -3.  -4.  -4.  -4.  -3.  -1.   0.   0.   0.
   0.   0.   0.   0.   0.   0.   0.   0.   0.   0.   0.   0.
   0.   0.   0.   0.   0.   0.   0.   0.   0.   0.   0.   0.
   0.   0.   0.   0.   0.   0.   0.   0.   0.   0.   0.   0.

参照

  • conv2 — 離散 2-D 畳み込み.
  • conv — 離散一次元畳み込み
  • convol — 畳込み(コンボリューション)
  • real — 実部
  • clean — 行列を消去 (小さなエントリをゼロに丸める)

履歴

バージョン記述
5.4.0 関数convol2dが導入されました.
Report an issue
<< convol Correlation Convolution corr >>

Copyright (c) 2022-2024 (Dassault Systèmes)
Copyright (c) 2017-2022 (ESI Group)
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Mon Jun 17 17:54:18 CEST 2024