texture_lawstexture_lawsTextureLawsTextureLawstexture_laws (算子)

名称

texture_lawstexture_lawsTextureLawsTextureLawstexture_laws — 使用劳斯(Laws)纹理过滤器过滤图像。

签名

texture_laws(Image : ImageTexture : FilterTypes, Shift, FilterSize : )

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)

void TextureLaws(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)

static void HOperatorSet.TextureLaws(HObject image, out HObject imageTexture, HTuple filterTypes, HTuple shift, HTuple filterSize)

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

def texture_laws(image: HObject, filter_types: str, shift: int, filter_size: int) -> HObject

描述

texture_lawstexture_lawsTextureLawsTextureLawsTextureLawstexture_laws applies a texture transformation (according to Laws) to an image. This is done by convolving the input image with a special filter mask. The filters are:

9 different 3×3 matrices obtainable from the following three vectors: l = [ 1 2 1 ], e = [ -1 0 1 ], s = [ -1 2 -1 ] 25 different 5×5 matrices obtainable from the following five vectors: 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 ], 49 different 7×7 matrices obtainable from the following seven vectors: 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 ] The names of the filters are mnemonics for “level,” “edge,” “spot,” “wave,” “ripple,” “undulation,” and “oscillation.”

For most of the filters the resulting gray values must be modified by a ShiftShiftShiftShiftshiftshift. This makes the different textures in the output image more comparable to each other, provided suitable filters are used.

The name of the filter is composed of the letters of the two vectors used, where the first letter denotes convolution in the column direction while the second letter denotes convolution in the row direction.

注意

texture_lawstexture_lawsTextureLawsTextureLawsTextureLawstexture_laws 可在 OpenCL 设备上执行。

请注意,若使用域缩减后的图像作为输入,滤波器算子可能会返回意外结果。请参阅 滤波器 一章

执行信息

参数

ImageImageImageImageimageimage (输入对象)  (multichannel-)image(-array) objectHImageHObjectHImageHobject (byte* / int2* / uint2*) *允许用于计算设备

Images to which the texture transformation is to be applied.

ImageTextureImageTextureImageTextureImageTextureimageTextureimage_texture (输出对象)  (multichannel-)image(-array) objectHImageHObjectHImageHobject * (byte / int2 / uint2)

Texture images.

FilterTypesFilterTypesFilterTypesFilterTypesfilterTypesfilter_types (输入控制)  string HTuplestrHTupleHtuple (string) (string) (HString) (char*)

Desired filter.

默认值: 'el' "el" "el" "el" "el" "el"

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

ShiftShiftShiftShiftshiftshift (输入控制)  integer HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Shift to reduce the gray value dynamics.

默认值: 2

建议值: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9

FilterSizeFilterSizeFilterSizeFilterSizefilterSizefilter_size (输入控制)  integer HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Size of the filter kernel.

默认值: 5

值列表: 3, 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_lawstexture_lawsTextureLawsTextureLawsTextureLawstexture_laws 在所有参数正确时返回 2 ( H_MSG_TRUE )。 如果输入为空则可设置行为通过 set_system('no_object_result',<Result>)set_system("no_object_result",<Result>)SetSystem("no_object_result",<Result>)SetSystem("no_object_result",<Result>)SetSystem("no_object_result",<Result>)set_system("no_object_result",<Result>)。如有必要,则抛出异常。

可能的后继

mean_imagemean_imageMeanImageMeanImageMeanImagemean_image, binomial_filterbinomial_filterBinomialFilterBinomialFilterBinomialFilterbinomial_filter, gauss_filtergauss_filterGaussFilterGaussFilterGaussFiltergauss_filter, median_imagemedian_imageMedianImageMedianImageMedianImagemedian_image, histo_2dimhisto_2dimHisto2dimHisto2dimHisto2dimhisto_2dim, learn_ndim_normlearn_ndim_normLearnNdimNormLearnNdimNormLearnNdimNormlearn_ndim_norm, thresholdthresholdThresholdThresholdThresholdthreshold

替代

convol_imageconvol_imageConvolImageConvolImageConvolImageconvol_image

另见

class_2dim_supclass_2dim_supClass2dimSupClass2dimSupClass2dimSupclass_2dim_sup, class_ndim_normclass_ndim_normClassNdimNormClassNdimNormClassNdimNormclass_ndim_norm

参考文献

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

模块

基础