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

gray_insidegray_insidegray_insideGrayInsideGrayInside (Operator)

Name

gray_insidegray_insidegray_insideGrayInsideGrayInside — Calculate the lowest possible gray value on an arbitrary path to the image border for each point in the image.

Signature

gray_inside(Image : ImageDist : : )

Herror gray_inside(const Hobject Image, Hobject* ImageDist)

Herror T_gray_inside(const Hobject Image, Hobject* ImageDist)

Herror gray_inside(Hobject Image, Hobject* ImageDist)

HImage HImage::GrayInside() const

HImageArray HImageArray::GrayInside() const

void HOperatorSetX.GrayInside(
[in] IHUntypedObjectX* Image, [out] IHUntypedObjectX*ImageDist)

IHImageX* HImageX.GrayInside()

static void HOperatorSet.GrayInside(HObject image, out HObject imageDist)

HImage HImage.GrayInside()

Description

gray_insidegray_insidegray_insideGrayInsideGrayInside determines the “cheapest” path to the image border for each point in the image, i.e., the path on which the lowest gray values have to be overcome. The resulting image contains the difference of the gray value of the particular point and the maximum gray value on the path. Bright areas in the result image therefore signify that these areas (which are typically dark in the original image) are surrounded by bright areas. Dark areas in the result image signify that there are only small gray value differences between them and the image border (which doesn't mean that they are surrounded by dark areas; a small “gap” of dark values suffices). The value 0 (black) in the result image signnifies that only darker or equally bright pixels exist on the path to the image border.

The operator is implemented by first segmenting into basins and watersheds the image using the watershedswatershedswatershedsWatershedsWatersheds operator. If the image is regarded as a gray value mountain range, basins are the places where water accumulates and the mountain ridges are the watersheds. Then, the watersheds are distributed to adjacent basins, thus leaving only basins. The border of the domain (region) of the original image is now searched for the lowest gray value, and the region in which it resides is given its result values. If the lowest gray value resides on the image border, all result values can be calculated immediately using the gray value differences to the darkest point. If the smalles found gray value lies in the interior of a basin, the lowest possible gray value has to be determined from the already processed adjacent basins in order to compute the new values. An 8-neighborhood is used to determine adjacency. The found region is subtracted from the regions yet to process, and the whole process is repeated. Thus, the image is “stripped” form the outside.

Analogously to watershedswatershedswatershedsWatershedsWatersheds, it is advisable to apply a smoothing operation before calling watershedswatershedswatershedsWatershedsWatersheds, e.g., binomial_filterbinomial_filterbinomial_filterBinomialFilterBinomialFilter or gauss_imagegauss_imagegauss_imageGaussImageGaussImage, in order to reduce the amount of regions that result from the watershed algorithm, and thus to speed up the processing time.

Parallelization

Parameters

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

Image being processed.

ImageDistImageDistImageDistImageDistimageDist (output_object)  (multichannel-)image(-array) objectHImageHImageHImageXHobject * (int2)

Result image.

Example (HDevelop)

read_image(Image,'coin')
gauss_image (Image,GaussImage,11)
open_window (0,0,512,512,0,'visible','',WindowHandle)
gray_inside(GaussImage,ImageOut)
disp_image (ImageOut,WindowHandle)

Example (C)

read_image(Image,"coin");
gauss_image(Image,&GaussImage,11);
open_window (0,0,512,512,0,"visible","",&WindowHandle);
gray_inside(GaussImage,Result);
disp_image(Result,WindowHandle);

Example (HDevelop)

read_image(Image,'coin')
gauss_image (Image,GaussImage,11)
open_window (0,0,512,512,0,'visible','',WindowHandle)
gray_inside(GaussImage,ImageOut)
disp_image (ImageOut,WindowHandle)

Example (HDevelop)

read_image(Image,'coin')
gauss_image (Image,GaussImage,11)
open_window (0,0,512,512,0,'visible','',WindowHandle)
gray_inside(GaussImage,ImageOut)
disp_image (ImageOut,WindowHandle)

Example (HDevelop)

read_image(Image,'coin')
gauss_image (Image,GaussImage,11)
open_window (0,0,512,512,0,'visible','',WindowHandle)
gray_inside(GaussImage,ImageOut)
disp_image (ImageOut,WindowHandle)

Result

gray_insidegray_insidegray_insideGrayInsideGrayInside always returns 2 (H_MSG_TRUE).

Possible Predecessors

binomial_filterbinomial_filterbinomial_filterBinomialFilterBinomialFilter, gauss_imagegauss_imagegauss_imageGaussImageGaussImage, smooth_imagesmooth_imagesmooth_imageSmoothImageSmoothImage, mean_imagemean_imagemean_imageMeanImageMeanImage, median_imagemedian_imagemedian_imageMedianImageMedianImage

Possible Successors

select_shapeselect_shapeselect_shapeSelectShapeSelectShape, area_centerarea_centerarea_centerAreaCenterAreaCenter, count_objcount_objcount_objCountObjCountObj

See also

watershedswatershedswatershedsWatershedsWatersheds

Module

Foundation


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