Herror ::plane_deviation (
    Hobject Regions,
    Hobject Image,
    double *Deviation
)
Herror ::plane_deviation (
    Hobject Regions,
    Hobject Image,
    HTuple *Deviation
)
double HRegion::PlaneDeviation (
    const HImage &Image
) const
HTuple HRegionArray::PlaneDeviation (
    const HImage &Image
) const

Calculate the deviation of the gray values from the approximating image plane.

The operator ::plane_deviation calculates the deviation of the gray values in Image from the approximation of the gray values through a plane. Contrary to the standard deviation in case of ::intensity slanted gray value planes also receive the value zero. The gray value plane is calculated according to ::gen_image_gray_ramp.

If F is the plane, alpha, beta, mean are the parameters of the image
plane and (r',c') is the center, Deviation is defined by:

  Deviation = sqrt(sum(((alpha*(r-r')+beta*(c-c')+mean)-Image(r,c))^2)/F) .


Attention

It should be noted that the calculation of Deviation does not follow the usual definition. It is defined to return the value 0.0 for an image with only one pixel.


Parameters

Regions (input_object)
region(-array) -> Hobject: HRegion(Array)
Regions, of which the plane deviation is to be calculated.

Image (input_object)
image -> Hobject: HImage ( byte )
Gray value image.

Deviation (output_control)
real(-array) -> (HTuple.) double *
Deviation of the gray values within a region.


Complexity

If F is the area of the region the runtime complexity amounts to O(F).


Result

The operator ::plane_deviation returns the value H_MSG_TRUE if Image is of the type byte. The behavior in case of empty input (no input images available) is set via the operator ::set_system('no_object_result',<Result>), the behavior in case of empty region is set via ::set_system('empty_region_result',<Result>). If necessary an exception handling is raised.


Alternatives

::intensity, ::gen_image_gray_ramp, ::sub_image


See also

::moments_gray_plane


Module

Image filters



Copyright © 1996-2002 MVTec Software GmbH