Herror ::intensity (
    Hobject Regions,
    Hobject Image,
    double *Mean,
    double *Deviation
)
Herror ::intensity (
    Hobject Regions,
    Hobject Image,
    HTuple *Mean,
    HTuple *Deviation
)
double HRegion::Intensity (
    const HImage &Image,
    double *Deviation
) const
HTuple HRegionArray::Intensity (
    const HImage &Image,
    HTuple *Deviation
) const

Calculate the mean and deviation of gray values.

The operator ::intensity calculates the mean and the deviation of the gray values in the input image within Regions. If R is a region, p a pixel from R with the gray value g(p) and F the plane (F = |R|), the features are defined by:

		  ----      
		  \
   Mean      =  /     g(p)
		  ----      
		 p in R
		 -----------
		      F

		   -----------------------
		   |    ----      
		   | 1  \                2
   Deviation =   | -  /     (g(p)-Mean)
		 \ | F  ----      
		  \|   p in R


Attention

The calculation of Deviation does not follow the usual definition if the region of the image contains only one pixel. In this case 0.0 is returned.


Parameters

Regions (input_object)
region(-array) -> Hobject: HRegion(Array)
Regions the features of which are to be calculated.

Image (input_object)
image -> Hobject: HImage ( byte / int1 / int2 / int4 / real )
Gray value image.

Mean (output_control)
real(-array) -> (HTuple.) double *
Mean gray value of a region.

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


Complexity

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


Result

The operator ::intensity returns the value H_MSG_TRUE. 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.


Possible Successors

::threshold


Alternatives

::select_gray, ::min_max_gray


See also

::mean_image, ::mean_image, ::gray_histo


Module

Image filters



Copyright © 1996-2002 MVTec Software GmbH