gen_filter_maskgen_filter_maskGenFilterMaskGenFilterMask (Operator)


gen_filter_maskgen_filter_maskGenFilterMaskGenFilterMask — Store a filter mask in the spatial domain as a real-image.


gen_filter_mask( : ImageFilter : FilterMask, Scale, Width, Height : )

Herror gen_filter_mask(Hobject* ImageFilter, const char* FilterMask, double Scale, const Hlong Width, const Hlong Height)

Herror T_gen_filter_mask(Hobject* ImageFilter, const Htuple FilterMask, const Htuple Scale, const Htuple Width, const Htuple Height)

void GenFilterMask(HObject* ImageFilter, const HTuple& FilterMask, const HTuple& Scale, const HTuple& Width, const HTuple& Height)

void HImage::GenFilterMask(const HTuple& FilterMask, double Scale, Hlong Width, Hlong Height)

void HImage::GenFilterMask(const HString& FilterMask, double Scale, Hlong Width, Hlong Height)

void HImage::GenFilterMask(const char* FilterMask, double Scale, Hlong Width, Hlong Height)

void HImage::GenFilterMask(const wchar_t* FilterMask, double Scale, Hlong Width, Hlong Height)   (Windows only)

static void HOperatorSet.GenFilterMask(out HObject imageFilter, HTuple filterMask, HTuple scale, HTuple width, HTuple height)

void HImage.GenFilterMask(HTuple filterMask, double scale, int width, int height)

void HImage.GenFilterMask(string filterMask, double scale, int width, int height)


gen_filter_maskgen_filter_maskGenFilterMaskGenFilterMaskGenFilterMask stores a filter mask in the spatial domain as a real-image. The center of the filter mask lies in the center of the resulting image. The parameter ScaleScaleScaleScalescale determines by which amount the values of the filter mask are multiplied (this results in larger values of the Fourier transform of the filter). The corresponding filter matrix, which is given in FilterMaskFilterMaskFilterMaskFilterMaskfilterMask can be generated either from a file or a tuple. The format of the filter matrix is described with the operator convol_imageconvol_imageConvolImageConvolImageConvolImage. Example filter masks can be found in the directory “filter” in the HALCON home directory. This operator is useful for visualizing the frequency response of filter masks (by applying a Fourier transform to the result image of this operator).

Execution Information


ImageFilterImageFilterImageFilterImageFilterimageFilter (output_object)  image objectHImageHImageHobject * (real)

Filter in the spatial domain.

FilterMaskFilterMaskFilterMaskFilterMaskfilterMask (input_control) HTupleHTupleHtuple (string / integer) (string / int / long) (HString / Hlong) (char* / Hlong)

Filter mask as file name or tuple.

Default value: 'gauss' "gauss" "gauss" "gauss" "gauss"

Suggested values: 'gauss'"gauss""gauss""gauss""gauss", 'laplace4'"laplace4""laplace4""laplace4""laplace4", 'laplace8'"laplace8""laplace8""laplace8""laplace8", 'lowpas_3_3'"lowpas_3_3""lowpas_3_3""lowpas_3_3""lowpas_3_3", 'lowpas_5_5'"lowpas_5_5""lowpas_5_5""lowpas_5_5""lowpas_5_5", 'lowpas_7_7'"lowpas_7_7""lowpas_7_7""lowpas_7_7""lowpas_7_7", 'lowpas_9_9'"lowpas_9_9""lowpas_9_9""lowpas_9_9""lowpas_9_9", 'sobel_c'"sobel_c""sobel_c""sobel_c""sobel_c", 'sobel_l'"sobel_l""sobel_l""sobel_l""sobel_l"

ScaleScaleScaleScalescale (input_control)  real HTupleHTupleHtuple (real) (double) (double) (double)

Scaling factor.

Default value: 1.0

Suggested values: 0.3, 0.5, 0.75, 1.0, 1.25, 1.5, 2.0

Typical range of values: 0.001 ≤ Scale Scale Scale Scale scale ≤ 10.0

Minimum increment: 0.001

Recommended increment: 0.1

Restriction: Scale > 0.0

WidthWidthWidthWidthwidth (input_control)  integer HTupleHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Width of the image (filter).

Default value: 512

Suggested values: 128, 160, 192, 256, 320, 384, 512, 640, 768, 1024, 2048, 4096, 8192

HeightHeightHeightHeightheight (input_control)  integer HTupleHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Height of the image (filter).

Default value: 512

Suggested values: 120, 128, 144, 240, 256, 288, 480, 512, 576, 1024, 2048, 4096, 8192

Example (HDevelop)

* If the filter should be read from a file:
gen_filter_mask (Filter, 'lowpas_3_3', 1.0, 512, 512)
* If the filter should be directly passed as a tuple:
gen_filter_mask (Filter, [3,3,9,1,1,1,1,1,1,1,1,1], 1.0, 512, 512)
fft_image (Filter, FilterFFT)
dev_set_paint ('3d_plot')
dev_display (FilterFFT)

Possible Successors

fft_imagefft_imageFftImageFftImageFftImage, fft_genericfft_genericFftGenericFftGenericFftGeneric

See also