HALCON Reference Manual 10.0.2
Table of Contents / Filters / Edges ClassesClassesClasses | | | Operators

laplacelaplacelaplaceLaplaceLaplace (Operator)

Name

laplacelaplacelaplaceLaplaceLaplace — Calculate the Laplace operator by using finite differences.

Signature

laplace(Image : ImageLaplace : ResultType, MaskSize, FilterMask : )

Herror laplace(const Hobject Image, Hobject* ImageLaplace, const char* ResultType, const Hlong MaskSize, const char* FilterMask)

Herror T_laplace(const Hobject Image, Hobject* ImageLaplace, const Htuple ResultType, const Htuple MaskSize, const Htuple FilterMask)

Herror laplace(Hobject Image, Hobject* ImageLaplace, const HTuple& ResultType, const HTuple& MaskSize, const HTuple& FilterMask)

HImage HImage::Laplace(const HTuple& ResultType, const HTuple& MaskSize, const HTuple& FilterMask) const

HImageArray HImageArray::Laplace(const HTuple& ResultType, const HTuple& MaskSize, const HTuple& FilterMask) const

void HOperatorSetX.Laplace(
[in] IHUntypedObjectX* Image, [out] IHUntypedObjectX*ImageLaplace, [in] VARIANT ResultType, [in] VARIANT MaskSize, [in] VARIANT FilterMask)

IHImageX* HImageX.Laplace(
[in] BSTR ResultType, [in] VARIANT MaskSize, [in] BSTR FilterMask)

static void HOperatorSet.Laplace(HObject image, out HObject imageLaplace, HTuple resultType, HTuple maskSize, HTuple filterMask)

HImage HImage.Laplace(string resultType, HTuple maskSize, string filterMask)

HImage HImage.Laplace(string resultType, int maskSize, string filterMask)

Description

laplacelaplacelaplaceLaplaceLaplace filters the input images ImageImageImageImageimage using a Laplace operator. Depending on the parameter FilterMaskFilterMaskFilterMaskFilterMaskfilterMask the following approximations of the Laplace operator are used:

'n_4'

                           1
                  1       -4      1
                           1

'n_8'

                  1       1       1
                  1       -8      1
                  1       1       1

'n_8_isotropic'

                  10      22     10
                  22     -128    22
                  10      22     10

For the three filter masks the following normelizations of the resulting gray values is applied, (i.e., by dividing the result by the given divisor): 'n_4' normalization by 1, 'n_8', normalization by 2 and for 'n_8_isotropic' normalization by 32.

For a Laplace operator with size 3x3, the corresponding filter is applied directly, while for larger filter sizes the input image is first smoothed using using a Gaussian filter (see gauss_imagegauss_imagegauss_imageGaussImageGaussImage) or a binomial filter (see binomial_filterbinomial_filterbinomial_filterBinomialFilterBinomialFilter) of size MaskSizeMaskSizeMaskSizeMaskSizemaskSize-2. The Gaussian filter is selected for the above values of ResultTypeResultTypeResultTypeResultTyperesultType. Here, MaskSizeMaskSizeMaskSizeMaskSizemaskSize = 5, 7, 9, 11, or 13 must be used. The binomial filter is selected by appending '_binomial'"_binomial""_binomial""_binomial""_binomial" to the above values of ResultTypeResultTypeResultTypeResultTyperesultType. Here, MaskSizeMaskSizeMaskSizeMaskSizemaskSize can be selected between 5 and 39. Furthermore, it is possible to select different amounts of smoothing for the column and row direction by passing two values in MaskSizeMaskSizeMaskSizeMaskSizemaskSize. Here, the first value of MaskSizeMaskSizeMaskSizeMaskSizemaskSize corresponds to the mask width (smoothing in the column direction), while the second value corresponds to the mask height (smoothing in the row direction) of the binomial filter. Therefore,

     laplace(O:R:'absolute',MaskSize,N:)

for MaskSize > 3 is equivalent to

     gauss_image(O:G:MaskSize-2:) >
     laplace(G:R:'absolute',3,N:).

and

     laplace(O:R:'absolute_binomial',MaskSize,N:)

is equivalent to

     binomial_filter(O:B:MaskSize-2,MaskSize-2:) >
     laplace(B:R:'absolute',3,N:).

laplacelaplacelaplaceLaplaceLaplace either returns the absolute value of the Laplace filtered image (ResultTypeResultTypeResultTypeResultTyperesultType = 'absolute'"absolute""absolute""absolute""absolute") in a byte or uint2 image or the signed result (ResultTypeResultTypeResultTypeResultTyperesultType = 'signed'"signed""signed""signed""signed" or 'signed_clipped'"signed_clipped""signed_clipped""signed_clipped""signed_clipped"). Here, the output image type has the same number of bytes per pixel as the input image (i.e., int1 or int2) for 'signed_clipped'"signed_clipped""signed_clipped""signed_clipped""signed_clipped", while the output image has the next larger number of pixels (i.e., int2 or int4) for 'signed'"signed""signed""signed""signed".

Parallelization

Parameters

ImageImageImageImageimage (input_object)  (multichannel-)image(-array) objectHImageHImageHImageXHobject (byte / uint2)

Input image.

ImageLaplaceImageLaplaceImageLaplaceImageLaplaceimageLaplace (output_object)  (multichannel-)image(-array) objectHImageHImageHImageXHobject * (byte / uint2 / int2 / int2 / int4)

Laplace-filtered result image.

ResultTypeResultTypeResultTypeResultTyperesultType (input_control)  string HTupleHTupleVARIANTHtuple (string) (string) (char*) (BSTR) (char*)

Type of the result image, whereas for byte and uint2 the absolute value is used.

Default value: 'absolute' "absolute" "absolute" "absolute" "absolute"

List of values: 'absolute'"absolute""absolute""absolute""absolute", 'signed_clipped'"signed_clipped""signed_clipped""signed_clipped""signed_clipped", 'signed'"signed""signed""signed""signed", 'absolute_binomial'"absolute_binomial""absolute_binomial""absolute_binomial""absolute_binomial", 'signed_clipped_binomial'"signed_clipped_binomial""signed_clipped_binomial""signed_clipped_binomial""signed_clipped_binomial", 'signed_binomial'"signed_binomial""signed_binomial""signed_binomial""signed_binomial"

MaskSizeMaskSizeMaskSizeMaskSizemaskSize (input_control)  integer(-array) HTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong)

Size of filter mask.

Default value: 3

List of values: 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39

FilterMaskFilterMaskFilterMaskFilterMaskfilterMask (input_control)  string HTupleHTupleVARIANTHtuple (string) (string) (char*) (BSTR) (char*)

Filter mask used in the Laplace operator

Default value: 'n_4' "n_4" "n_4" "n_4" "n_4"

List of values: 'n_4'"n_4""n_4""n_4""n_4", 'n_8'"n_8""n_8""n_8""n_8", 'n_8_isotropic'"n_8_isotropic""n_8_isotropic""n_8_isotropic""n_8_isotropic"

Example (C)

read_image(&Image,"mreut");
laplace(Image,&Laplace,"signed",3,"n_8_isotropic");
zero_crossing(Laplace,&ZeroCrossings);

Result

laplacelaplacelaplaceLaplaceLaplace returns 2 (H_MSG_TRUE) if all parameters are correct. If the input is empty the behaviour can be set via set_system('no_object_result',<Result>)set_system("no_object_result",<Result>)set_system("no_object_result",<Result>)SetSystem("no_object_result",<Result>)SetSystem("no_object_result",<Result>). If necessary, an exception is raised.

Possible Successors

zero_crossingzero_crossingzero_crossingZeroCrossingZeroCrossing, dual_thresholddual_thresholddual_thresholdDualThresholdDualThreshold, thresholdthresholdthresholdThresholdThreshold

Alternatives

diff_of_gaussdiff_of_gaussdiff_of_gaussDiffOfGaussDiffOfGauss, laplace_of_gausslaplace_of_gausslaplace_of_gaussLaplaceOfGaussLaplaceOfGauss, derivate_gaussderivate_gaussderivate_gaussDerivateGaussDerivateGauss

See also

highpass_imagehighpass_imagehighpass_imageHighpassImageHighpassImage, edges_imageedges_imageedges_imageEdgesImageEdgesImage

Module

Foundation


Table of Contents / Filters / Edges ClassesClassesClasses | | | Operators
HALCON Reference Manual 10.0.2 Copyright © 1996-2011 MVTec Software GmbH