Skip to content

gray_opening_shapeGrayOpeningShapeGrayOpeningShapegray_opening_shapegray_opening_shape🔗

説明🔗

gray_opening_shapeGrayOpeningShapeGrayOpeningShapegray_opening_shapegray_opening_shape — 選択されたマスクによってグレイ値のオープニングを実行する。

書式🔗

gray_opening_shape( image Image, out image ImageOpening, extent.y MaskHeight, extent.x MaskWidth, string MaskShape )void GrayOpeningShape( const HObject& Image, HObject* ImageOpening, const HTuple& MaskHeight, const HTuple& MaskWidth, const HTuple& MaskShape )static void HOperatorSet.GrayOpeningShape( HObject image, out HObject imageOpening, HTuple maskHeight, HTuple maskWidth, HTuple maskShape )def gray_opening_shape( image: HObject, mask_height: Union[int, float], mask_width: Union[int, float], mask_shape: str ) -> HObject

Herror gray_opening_shape( const Hobject Image, Hobject* ImageOpening, double MaskHeight, double MaskWidth, const char* MaskShape )

Herror T_gray_opening_shape( const Hobject Image, Hobject* ImageOpening, const Htuple MaskHeight, const Htuple MaskWidth, const Htuple MaskShape )

HImage HImage::GrayOpeningShape( const HTuple& MaskHeight, const HTuple& MaskWidth, const HString& MaskShape ) const

HImage HImage::GrayOpeningShape( double MaskHeight, double MaskWidth, const HString& MaskShape ) const

HImage HImage::GrayOpeningShape( double MaskHeight, double MaskWidth, const char* MaskShape ) const

HImage HImage::GrayOpeningShape( double MaskHeight, double MaskWidth, const wchar_t* MaskShape ) const (Windows only)

HImage HImage.GrayOpeningShape( HTuple maskHeight, HTuple maskWidth, string maskShape )

HImage HImage.GrayOpeningShape( double maskHeight, double maskWidth, string maskShape )

説明🔗

gray_opening_shapeGrayOpeningShape は、形状 MaskShapemaskShapemask_shape の構造要素 を用いて入力画像 Imageimageimage に対してグレイ値のオープニングを適 用します。 マスクのオフセット値は 0 とし、マスクの水平、垂直方向のサイズは MaskHeightmaskHeightmask_height と MaskWidthmaskWidthmask_width によって定義されます。結 果の画像は ImageOpeningimageOpeningimage_opening に返されます。

もしパラメーター MaskHeightmaskHeightmask_height もしくは MaskWidthmaskWidthmask_width に整数型で偶数を指定した場合、その値はより大きい次の奇数の値に変え られます。 対照的に、2 つのパラメーターの少なくとも 1 つが浮動小数点型であれ ば、入力画像 Imageimageimage は次に大きく次に小さい奇数のマスクサイ ズで変換され、出力画像 ImageOpeningimageOpeningimage_opening は 2 つの中間像から補 間されます。したがって、gray_opening_shapeGrayOpeningShape は、例えば 44 と 4.04.0 のマスクサイズには異なる結果を返すこと に注意してください。

MaskShapemaskShapemask_shape の制御パラメーターの値が ‘rhombus’、’octagon’の 場合、MaskHeightmaskHeightmask_height と MaskWidthmaskWidthmask_width は同じ値でなければ なりません。MaskShapemaskShapemask_shape のパラメーター値 ‘octagon’ は円の構 造に適応するように近似した正八角形のマスクを示します。 画像の境界ではグレイ値はミラーリングされます。

構造要素 \(s\) を持つ画像 \(i\) のグレイ値のオープニングは次のように定 義されます。

\[\begin{eqnarray*} i \circ s = (i \ominus s) \oplus s \enspace , \end{eqnarray*}\]

すなわち、画像を \(s\) で膨張させた後に、\(s\) で収縮を行う処理を意味 します(gray_erosion_shapeGrayErosionShape および gray_dilation_shapeGrayDilationShape を参照してください)。

注意🔗

gray_opening_shapeGrayOpeningShape は、浮動小数点型のマスクサイズには、整 数型のマスクサイズよりもかなりの時間を要することに注意してくださ い。このことは、幅と高さが異なる矩形マスクに特に当てはまります。

gray_opening_shapeGrayOpeningShape はOpenCLデバイス上で実行できます。 浮動小数点型のマスクサイズが設定された場合、OpenCLデバイス上では 単精度にて補間が計算される為にCPUの結果とわずかに異なる可能性があります。

入力画像としてドメインを絞り込んだ画像を用いた場合、期待しない結果と なる場合があります。章Filters を確認ください。

実行情報🔗

実行情報
  • OpenCL演算デバイスによる演算をサポート

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

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

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

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

  • ドメインレベルで自動的に並列演算処理を実施

パラメーター🔗

Imageimageimage (input_object) (multichannel-)image(-array) → object (byte* / uint2*)HObject (byte* / uint2*)HImage (byte* / uint2*)HObject (byte* / uint2*)Hobject (byte* / uint2*) *計算デバイスに対して有効

最小グレイ値を計算するための画像

ImageOpeningimageOpeningimage_opening (output_object) (multichannel-)image(-array) → object (byte / uint2)HObject (byte / uint2)HImage (byte / uint2)HObject (byte / uint2)Hobject * (byte / uint2)

最小グレイ値を含む画像

MaskHeightmaskHeightmask_height (input_control) extent.y → (real / integer)HTuple (double / Hlong)HTuple (double / int / long)Union[int, float]Htuple (double / Hlong)

フィルターマスクの高さ

初期値: 1111
推奨値: 3, 5, 7, 9, 11, 13, 153, 5, 7, 9, 11, 13, 15
値域: 1.0 ≤ MaskHeight ≤ 511.0

MaskWidthmaskWidthmask_width (input_control) extent.x → (real / integer)HTuple (double / Hlong)HTuple (double / int / long)Union[int, float]Htuple (double / Hlong)

フィルターマスクの幅

初期値: 1111
推奨値: 3, 5, 7, 9, 11, 13, 153, 5, 7, 9, 11, 13, 15
値域: 1.0 ≤ MaskWidth ≤ 511.0

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

マスクの形状

初期値: 'octagon'"octagon"
値のリスト: 'octagon', 'rectangle', 'rhombus'"octagon", "rectangle", "rhombus"

結果🔗

gray_opening_shapeGrayOpeningShape は、すべてのパラメーターが正しい場合に 2 (H_MSG_TRUE) を返します。

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

組み合わせ

他の選択候補

gray_openingGrayOpening

関連項目

gray_dilation_shapeGrayDilationShape, gray_erosion_shapeGrayErosionShape, openingOpening

モジュール🔗

Foundation