Skip to content

fft_genericFftGenericFftGenericfft_genericfft_generic🔗

説明🔗

fft_genericFftGenericFftGenericfft_genericfft_generic — 画像の高速フーリエ変換を計算する。

書式🔗

fft_generic( image Image, out image ImageFFT, string Direction, integer Exponent, string Norm, string Mode, string ResultType )void FftGeneric( const HObject& Image, HObject* ImageFFT, const HTuple& Direction, const HTuple& Exponent, const HTuple& Norm, const HTuple& Mode, const HTuple& ResultType )static void HOperatorSet.FftGeneric( HObject image, out HObject imageFFT, HTuple direction, HTuple exponent, HTuple norm, HTuple mode, HTuple resultType )def fft_generic( image: HObject, direction: str, exponent: int, norm: str, mode: str, result_type: str ) -> HObject

Herror fft_generic( const Hobject Image, Hobject* ImageFFT, const char* Direction, const Hlong Exponent, const char* Norm, const char* Mode, const char* ResultType )

Herror T_fft_generic( const Hobject Image, Hobject* ImageFFT, const Htuple Direction, const Htuple Exponent, const Htuple Norm, const Htuple Mode, const Htuple ResultType )

HImage HImage::FftGeneric( const HString& Direction, Hlong Exponent, const HString& Norm, const HString& Mode, const HString& ResultType ) const

HImage HImage::FftGeneric( const char* Direction, Hlong Exponent, const char* Norm, const char* Mode, const char* ResultType ) const

HImage HImage::FftGeneric( const wchar_t* Direction, Hlong Exponent, const wchar_t* Norm, const wchar_t* Mode, const wchar_t* ResultType ) const (Windows only)

HImage HImage.FftGeneric( string direction, int exponent, string norm, string mode, string resultType )

説明🔗

fft_genericFftGeneric は、入力画像 Imageimageimage の高速フーリエ変換 を実行します。フーリエ変換と逆フーリエ変換に関する定義がいくつかあ りますが、このオペレーターは、もっとも一般的に使用される定義に基づいています。

フーリエ変換に関する一般の定義を以下に示します。

\[\begin{eqnarray*} F(m,n) = \frac{1}{c} \sum_{k=0}^{M-1} \sum_{l=0}^{N-1} e^{s 2 \pi i (k m / M + l n / N)} f(k,l) \end{eqnarray*}\]

オプションは、指数内の符号 s がフーリエ変換に対して 1 と 設定されるべきか -1 と設定されるべきかによって変わります。また、正 規化因子 c に関する大きさの不一致が存在します。つまり、 フーリエ変換に対して 1 に設定されたり、M*N に設定された り、\(\sqrt{MN}\)(@単一 FFT の場合)に設定されたり します。特に画像処理アプリケーションにおいて、DC 項は画像の中心に シフトされます。

fft_genericFftGeneric は、個別にこれらの選択を行うことができます。 パラメーター Directiondirectiondirection では、FFT の論理的な方向の選択を行うことが 可能です(このパラメーターが必要な場合があります。もし DC 項が画像の中心にあるべきであるならば、画像をシフトする方法を判別す るために必要となります)。可能な値は、'to_freq'"to_freq" と 'from_freq'"from_freq" です。パラメーター Exponentexponentexponent は指数に 関する符号を決定するために使用されます。それは 1 か -1 に設定でき ます。 正規化された要素は Normnormnorm を用いて設定され、値 'none'"none"、'sqrt'"sqrt"、および 'n'"n" を選択することが できます。 パラメーター Modemodemode は FFT の DC 項の位置を決定します。それ は 'dc_center'"dc_center" か 'dc_edge'"dc_edge" に設定できます。

いずれの場合でも、パラメーターの矛盾が生じないようにしなければなり ません。これは、フーリエ変換と逆変換に対して使用される正規化因子 が、M*N を生じなければならない、指数は逆の符号でなければ ならない、そして Modemodemode は両方の変換に対して等しくなければ ならない、ことを意味しています。

矛盾しない組み合わせは、フーリエ変換に対しては、たとえば '(to_freq,-1,n,dc_edge)'"(to_freq,-1,n,dc_edge)" であり、逆変換に対しては '(from_freq,1,none,dc_edge)'"(from_freq,1,none,dc_edge)" です。 この場合、FFT は三角法の基礎関数を用いた補間として解釈されます。別 の有用な組み合わせは、'(to_freq,-1,sqrt,dc_center)'"(to_freq,-1,sqrt,dc_center)" と '(from_freq,1,sqrt,dc_center)'"(from_freq,1,sqrt,dc_center)" です。

パラメーター ResultTyperesultTyperesult_type は逆変換(Directiondirectiondirection \(=\) 'from_freq'"from_freq")の結果画像タイプを指定するために使用すること ができます。フーリエ変換(Directiondirectiondirection \(=\) 'to_freq'"to_freq")の場合、ResultTyperesultTyperesult_type は 'complex'"complex" に設定する必要があります。

注意🔗

変換は常に全画像に対して行われます。つまり、画像のドメインは無視されます。

実行情報🔗

実行情報
  • マルチスレッドタイプ: リエントラント(非排他なオペレーターと並列に動作)

  • マルチスレッドスコープ: グローバル(他のスレッドから呼び出される可能性あり)

  • tupleレベルで自動的に並列演算処理を実施

  • チャンネルレベルで自動的に並列演算処理を実施

  • 内部データレベルで自動的に並列演算処理を実施

パラメーター🔗

Imageimageimage (input_object) (multichannel-)image(-array) → object (byte / direction / cyclic / int1 / int2 / uint2 / int4 / real / complex)HObject (byte / direction / cyclic / int1 / int2 / uint2 / int4 / real / complex)HImage (byte / direction / cyclic / int1 / int2 / uint2 / int4 / real / complex)HObject (byte / direction / cyclic / int1 / int2 / uint2 / int4 / real / complex)Hobject (byte / direction / cyclic / int1 / int2 / uint2 / int4 / real / complex)

入力画像

ImageFFTimageFFTimage_fft (output_object) image(-array) → object (byte / direction / cyclic / int1 / int2 / uint2 / int4 / real / complex)HObject (byte / direction / cyclic / int1 / int2 / uint2 / int4 / real / complex)HImage (byte / direction / cyclic / int1 / int2 / uint2 / int4 / real / complex)HObject (byte / direction / cyclic / int1 / int2 / uint2 / int4 / real / complex)Hobject * (byte / direction / cyclic / int1 / int2 / uint2 / int4 / real / complex)

フーリエ変換された画像

Directiondirectiondirection (input_control) string → (string)HTuple (HString)HTuple (string)strHtuple (char*)

変換の方向の指定

初期値: 'to_freq'"to_freq"
値のリスト: 'from_freq', 'to_freq'"from_freq", "to_freq"

Exponentexponentexponent (input_control) integer → (integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

指数の符号

初期値: -1-1
値のリスト: -1, 1-1, 1

Normnormnorm (input_control) string → (string)HTuple (HString)HTuple (string)strHtuple (char*)

変換の正規化因子

初期値: 'sqrt'"sqrt"
値のリスト: 'n', 'none', 'sqrt'"n", "none", "sqrt"

Modemodemode (input_control) string → (string)HTuple (HString)HTuple (string)strHtuple (char*)

周波数領域内の DC 項の位置

初期値: 'dc_center'"dc_center"
値のリスト: 'dc_center', 'dc_edge'"dc_center", "dc_edge"

ResultTyperesultTyperesult_type (input_control) string → (string)HTuple (HString)HTuple (string)strHtuple (char*)

出力画像の画像タイプ

初期値: 'complex'"complex"
値のリスト: 'byte', 'complex', 'cyclic', 'direction', 'int1', 'int2', 'int4', 'real', 'uint2'"byte", "complex", "cyclic", "direction", "int1", "int2", "int4", "real", "uint2"

例🔗

(C)

/* simulation of fft_image */
void my_fft(Hobject In, Hobject *Out)
{
  fft_generic(In,Out,"to_freq",-1,"sqrt","dc_center","complex")\;
}

/* simulation of fft_image_inv */
void my_fft_image_inv(Hobject In, Hobject *Out)
{
  fft_generic(In,Out,"from_freq",1,"sqrt","dc_center","byte")\;
}

結果🔗

fft_genericFftGeneric は、すべてのパラメーターが正しい場合に 2 (H_MSG_TRUE) を 返します。入力が空の場合、 set_system(::'no_object_result',<Result>:) を通じて設定す ることができます。必要に応じて、例外が発生します。

他のオペレーターとの組み合わせ🔗

組み合わせ

前処理の候補

optimize_fft_speedOptimizeFftSpeed, read_fft_optimization_dataReadFftOptimizationData

後処理の候補

convol_fftConvolFft, correlation_fftCorrelationFft, phase_correlation_fftPhaseCorrelationFft, convol_gaborConvolGabor, convert_image_typeConvertImageType, power_bytePowerByte, power_realPowerReal, power_lnPowerLn, phase_degPhaseDeg, phase_radPhaseRad, energy_gaborEnergyGabor

他の選択候補

fft_imageFftImage, fft_image_invFftImageInv, rft_genericRftGeneric

モジュール🔗

Foundation