Herror ::bottom_hat (
    Hobject Region,
    Hobject StructElement,
    Hobject *RegionBottomHat
)
HRegion HRegion::BottomHat (
    const HRegion &StructElement
) const
HRegionArray HRegionArray::BottomHat (
    const HRegion &StructElement
) const

Compute the bottom hat of regions.

::bottom_hat computes the ::closing of Region with StructElement. The difference between the result of the closing and the original region is called the bottom hat. In contrast to ::closing, which merges regions under certain circumstances, ::bottom_hat computes the regions generated by such a merge.

The position of StructElement is meaningless, since a closing operation is invariant with respect to the choice of the reference point.

Structuring elements (StructElement) can be generated with operators such as ::gen_circle, ::gen_rectangle1, ::gen_rectangle2, ::gen_ellipse, ::draw_region, ::gen_region_polygon, ::gen_region_points, etc.


Parameters

Region (input_object)
region(-array) -> Hobject: HRegion(Array)
Regions to be processed.

StructElement (input_object)
region -> Hobject: HRegion
Structuring element (position independent).

RegionBottomHat (output_object)
region(-array) -> Hobject * : HRegion(Array)
Result of the bottom hat operator.


Example
#include "HalconCpp.h"

main()
{
  HByteImage    Monkey("monkey");
  HWindow       w;

  HRegion regs = (Monkey >= 128);
  HRegion circ = HRegion::GenCircle (128, 128, 3);

  HRegion rbht = regs.BottomHat (circ);

  Monkey.Display (w);  w.Click ();
  w.SetColor ("red");     regs.Display (w);  w.Click ();
  w.SetColor ("green");   rbht.Display (w);  w.Click ();

  return(0);
}

Result

::bottom_hat returns H_MSG_TRUE if all parameters are correct. The behavior in case of empty or no input region can be set via:

  a) no region:    set_system('no_object_result',<RegionResult>)
  b) empty region: set_system('empty_region_result',<RegionResult>)
Otherwise, an exception is raised.


Possible Predecessors

::threshold, ::regiongrowing, ::connection, ::union1, ::watersheds, ::class_ndim_norm, ::gen_circle, ::gen_ellipse, ::gen_rectangle1, ::gen_rectangle2, ::draw_region, ::gen_region_points, ::gen_struct_elements, ::gen_region_polygon_filled


Possible Successors

::reduce_domain, ::select_shape, ::area_center, ::connection


Alternatives

::closing, ::difference


See also

::top_hat, ::morph_hat, ::gray_bothat, ::opening


Module

Morphology



Copyright © 1996-2002 MVTec Software GmbH