Herror ::laplace (
    Hobject Image,
    Hobject *ImageLaplace,
    const HTuple &FilterType,
    const HTuple &Size,
    const HTuple &NeighbourhoodType
)
HImage HImage::Laplace (
    const HTuple &FilterType,
    const HTuple &Size,
    const HTuple &NeighbourhoodType
) const
HImageArray HImageArray::Laplace (
    const HTuple &FilterType,
    const HTuple &Size,
    const HTuple &NeighbourhoodType
) const

Calculate the Laplace operator by using finite differences.

::laplace filters the input images Image using a Laplace operator. Depending on the parameter NeighbourhoodType the following simple 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_isotrop':      
                  10      22     10
                  22     -128    22
                  10      22     10
The filter 'n_8' corresponds to the filter mask used in ::highpass_image(O,R,3,3). For a Laplace operator with size 3x3, the corresponding filter is applied directly, while for larger filter sizes (Size = 5,7,9 and 11) the input image is first smoothed using a Gaussian filter of the selected size. Therefore,
     laplace(O:R:int4,S,N:)

for Size > 3 is equivalent to

     gauss_image(O:G:S:) >
     laplace(G:R:int4,3,N:).
::laplace either returns the absolute value of the Laplace filtered image (FilterType 'abs') in a byte-image or the signed result (FilterType 'int4') in an int4-image.


Attention

::laplace is only implemented for byte-images.


Parameters

Image (input_object)
(multichannel-)image(-array) -> Hobject: HImage(Array) ( byte )
Input image.

ImageLaplace (output_object)
(multichannel-)image(-array) -> Hobject * : HImage(Array) ( byte / int4 )
Laplace-filtered result images.

FilterType (input_control)
string -> HTuple.char *
Calculate the absolute value of the filter to a byte-image or the signed result to an int4-image.
Default value: 'int4'
List of values: 'abs', 'int4'

Size (input_control)
integer -> HTuple.long
Size of filter mask.
Default value: 3
List of values: 3, 5, 7, 9, 11

NeighbourhoodType (input_control)
string -> HTuple.char *
Neighborhood used in the Laplace operator
Default value: 'n_8_isotrop'
List of values: 'n_4', 'n_8', 'n_8_isotrop'


Example
read_image(&Image,"mreut");
laplace(Image,&Laplace,"int4",3,"n_8_isotrop");
zero_crossing(Laplace,&ZeroCrossings);

Result

::laplace returns 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>). If necessary, an exception handling is raised.


Possible Successors

::zero_crossing, ::dual_threshold


Alternatives

::diff_of_gauss, ::laplace_of_gauss


See also

::highpass_image, ::edges_image


Module

Image filters



Copyright © 1996-2002 MVTec Software GmbH