Skip to content

texture_lawsTextureLawsTextureLawstexture_lawstexture_laws🔗

説明🔗

texture_lawsTextureLawsTextureLawstexture_lawstexture_laws — Lawsテキスチャフィルタを用いて画像のフィルタ処理をする。

書式🔗

texture_laws( image Image, out image ImageTexture, string FilterTypes, integer Shift, integer FilterSize )void TextureLaws( const HObject& Image, HObject* ImageTexture, const HTuple& FilterTypes, const HTuple& Shift, const HTuple& FilterSize )static void HOperatorSet.TextureLaws( HObject image, out HObject imageTexture, HTuple filterTypes, HTuple shift, HTuple filterSize )def texture_laws( image: HObject, filter_types: str, shift: int, filter_size: int ) -> HObject

Herror texture_laws( const Hobject Image, Hobject* ImageTexture, const char* FilterTypes, const Hlong Shift, const Hlong FilterSize )

Herror T_texture_laws( const Hobject Image, Hobject* ImageTexture, const Htuple FilterTypes, const Htuple Shift, const Htuple FilterSize )

HImage HImage::TextureLaws( const HString& FilterTypes, Hlong Shift, Hlong FilterSize ) const

HImage HImage::TextureLaws( const char* FilterTypes, Hlong Shift, Hlong FilterSize ) const

HImage HImage::TextureLaws( const wchar_t* FilterTypes, Hlong Shift, Hlong FilterSize ) const (Windows only)

HImage HImage.TextureLaws( string filterTypes, int shift, int filterSize )

説明🔗

texture_lawsTextureLaws は、画像に対して (Lawsに従った) 1つのテクスチャー変換を 適用します。これは、入力画像を特殊なフィルタマスクで畳み込むことによって 行われます。そのフィルタは、以下のとおりです:

次に示す 3つのベクトルから得られる 9つの相異なる 3×3 マトリックス:

      l      =       [  1     2       1  ],
      e      =       [ -1     0       1  ],
      s      =       [ -1     2      -1  ]

次に示す 5つのベクトルから得られる 25の相違なる 5×5 マトリックス:

      l      =       [  1     4       6       4       1 ],
      e      =       [ -1    -2       0       2       1 ],
      s      =       [ -1     0       2       0      -1 ],
      w      =       [ -1     2       0      -2       1 ]
      r      =       [  1    -4       6      -4       1 ],

次に示す 7つのベクトルから得られる 49の異なる 7×7 マトリックス:

      l      =       [  1     6      15      20      15      6      1  ],
      e      =       [ -1    -4      -5       0       5      4      1  ],
      s      =       [ -1    -2       1       4       1     -2     -1  ],
      w      =       [ -1     0       3       0      -3      0      1  ],
      r      =       [  1    -2      -1       4      -1     -2      1  ],
      u      =       [  1    -4       5       0      -5      4     -1  ]
      o      =       [ -1     6     -15      20     -15      6     -1  ]

ほとんどのフィルタに対して、結果として得られるグレイ値は Shiftshiftshift により修正されなければなりません。これは、もし適切なフィルタが使用される ならば、出力画像における異なるテクスチャを互いによりよく比較できるように します。

フィルタ名は使用される 2つのベクトルの文字から構成されます。ここで最初の 文字は列方向の畳込みで、2番目の文字は行方向の畳込みを記述します。

注意🔗

texture_lawsTextureLaws はOpenCLデバイス上で実行できます。

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

実行情報🔗

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

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

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

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

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

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

パラメーター🔗

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

テクスチャ変換を適用する画像

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

結果としてのテクスチャ画像

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

要求されるフィルタ(名前または番号).

初期値: 'el'"el"
推奨値: 'll', 'le', 'ls', 'lw', 'lr', 'lu', 'lo', 'el', 'ee', 'es', 'ew', 'er', 'eu', 'eo', 'sl', 'se', 'ss', 'sw', 'sr', 'su', 'so', 'wl', 'we', 'ws', 'ww', 'wr', 'wu', 'wo', 'rl', 're', 'rs', 'rw', 'rr', 'ru', 'ro', 'ul', 'ue', 'us', 'uw', 'ur', 'uu', 'uo', 'ol', 'oe', 'os', 'ow', 'or', 'ou', 'oo'"ll", "le", "ls", "lw", "lr", "lu", "lo", "el", "ee", "es", "ew", "er", "eu", "eo", "sl", "se", "ss", "sw", "sr", "su", "so", "wl", "we", "ws", "ww", "wr", "wu", "wo", "rl", "re", "rs", "rw", "rr", "ru", "ro", "ul", "ue", "us", "uw", "ur", "uu", "uo", "ol", "oe", "os", "ow", "or", "ou", "oo"

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

グレイ値ダイナミクスを低減するためのシフト

初期値: 22
推奨値: 0, 1, 2, 3, 4, 5, 6, 7, 8, 90, 1, 2, 3, 4, 5, 6, 7, 8, 9

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

フィルタカーネルのサイズ

初期値: 55
値のリスト: 3, 5, 73, 5, 7

例🔗

(HDevelop)


* Simple two-dimensional pixel classification
dev_get_window (WindowHandle)
read_image(Image,'combine')
texture_laws(Image,Texture1,'es',3,7)
texture_laws(Image,Texture2,'le',7,7)
MaskSize := 51
mean_image(Texture1,H1,MaskSize,MaskSize)
mean_image(Texture2,H2,MaskSize,MaskSize)
dev_clear_window ()
dev_display (Image)
dev_set_color ('green')
write_string (WindowHandle, 'Mark region within one texture area')
draw_region(Region,WindowHandle)
reduce_domain(H1,Region,Foreground1)
reduce_domain(H2,Region,Foreground2)
histo_2dim(Region,Foreground1,Foreground2,Histo)
get_image_size (Image, Width, Height)
threshold(Histo,Characteristic_area,1,Width*Height)
ShowIntermediateResult := 0
if (ShowIntermediateResult)
  histo_2dim(H1,H1,H2,HistoFull)
  dev_clear_window ()
  dev_set_lut ('sqrt')
  dev_display (HistoFull)
  dev_set_draw ('margin')
  dev_display (Characteristic_area)
  stop ()
  dev_set_lut ('default')
  dev_set_draw ('fill')
endif
class_2dim_sup(H1,H2,Characteristic_area,Seg)
dev_display (Image)
dev_set_color ('red')
dev_display (Seg)

結果🔗

すべてのパラメーターが正しい場合、texture_lawsTextureLawsは、2 (H_MSG_TRUE) を返します。 入力が空である場合、set_system('no_object_result',<Result>). を通して動作します。 必要であれば、例外処理が発生します。

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

組み合わせ

後処理の候補

mean_imageMeanImage, binomial_filterBinomialFilter, gauss_filterGaussFilter, median_imageMedianImage, histo_2dimHisto2dim, learn_ndim_normLearnNdimNorm, thresholdThreshold

他の選択候補

convol_imageConvolImage

関連項目

class_2dim_supClass2dimSup, class_ndim_normClassNdimNorm

参考文献🔗

Laws, Kenneth Ivan. “Textured Image Segmentation”; Ph.D. Thesis, Department of Electrical Engineering, Image Processing Institute, University of Southern California, 1980

モジュール🔗

Foundation