Herror ::histo_2dim (
    Hobject Regions,
    Hobject ImageCol,
    Hobject ImageRow,
    Hobject *Histo2Dim
)
HImage HRegion::Histo2dim (
    const HImage &ImageCol,
    const HImage &ImageRow
) const
HImage HRegionArray::Histo2dim (
    const HImage &ImageCol,
    const HImage &ImageRow
) const

Calculate the histogram of two-channel gray value images.

The operator ::histo_2dim calculates the 2-dimensional histogram of two images within Regions. The gray values of channel 1 (ImageCol) are interpreted as row index, those of channel 2 (ImageRow) as column index. The gray value at one point P(g1,g2) in the output image Histo2Dim indicates the frequency of the gray value combination (g1,g2) with g1 indicating the line index and g2 the column index.


Parameters

Regions (input_object)
region(-array) -> Hobject: HRegion(Array)
Region in which the histogram is to be calculated.

ImageCol (input_object)
image -> Hobject: HImage ( byte / direction / cyclic / int1 )
Channel 1.

ImageRow (input_object)
image -> Hobject: HImage ( byte )
Channel 2.

Histo2Dim (output_object)
image -> Hobject * : HImage ( int4 )
Histogram to be calculated.


Example
#include  <iostream.h>
#include  "HalconCpp.h"

main()
{
  HImage   img ("affe");
  HImage   tex = img.LawsByte ("el", 1, 5);
  HWindow  w;

  img.Display (w);
  w.Click ();
  HRegion     reg = w.DrawRegion ();
  HImage      h2d = reg.Histo2dim (tex, img);
  w.SetPart (0, 0, 255, 255);
  h2d.Display (w);
  w.Click ();
  return(0);
}

Complexity

If F is the plane of the region, the runtime complexity is O(F + 256^2).


Result

The operator ::histo_2dim returns the value H_MSG_TRUE if both images have defined gray values. 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 Predecessors

::decompose3, ::decompose2, ::draw_region


Possible Successors

::threshold, ::class_2dim_sup, ::pouring, ::local_max, ::gray_skeleton


Alternatives

::gray_histo


See also

::get_grayval


Module

Image filters



Copyright © 1996-2002 MVTec Software GmbH