HALCON Reference Manual 10.0.2
Table of Contents / Image / Features ClassesClassesClasses | | | Operators

histo_2dimhisto_2dimhisto_2dimHisto2dimHisto2dim (Operator)

Name

histo_2dimhisto_2dimhisto_2dimHisto2dimHisto2dim — Calculate the histogram of two-channel gray value images.

Signature

histo_2dim(Regions, ImageCol, ImageRow : Histo2Dim : : )

Herror histo_2dim(const Hobject Regions, const Hobject ImageCol, const Hobject ImageRow, Hobject* Histo2Dim)

Herror T_histo_2dim(const Hobject Regions, const Hobject ImageCol, const Hobject ImageRow, Hobject* Histo2Dim)

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

void HOperatorSetX.Histo2dim(
[in] IHUntypedObjectX* Regions, [in] IHUntypedObjectX* ImageCol, [in] IHUntypedObjectX* ImageRow, [out] IHUntypedObjectX*Histo2Dim)

IHImageX* HImageX.Histo2dim(
[in] IHRegionX* Regions, [in] IHImageX* ImageRow)

IHImageX* HRegionX.Histo2dim(
[in] IHImageX* ImageCol, [in] IHImageX* ImageRow)

static void HOperatorSet.Histo2dim(HObject regions, HObject imageCol, HObject imageRow, out HObject histo2Dim)

HImage HImage.Histo2dim(HRegion regions, HImage imageRow)

HImage HRegion.Histo2dim(HImage imageCol, HImage imageRow)

Description

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

Parallelization

Parameters

RegionsRegionsRegionsRegionsregions (input_object)  region(-array) objectHRegionHRegionHRegionXHobject

Region in which the histogram is to be calculated.

ImageColImageColImageColImageColimageCol (input_object)  image objectHImageHImageHImageXHobject (byte / direction / cyclic / int1)

Channel 1.

ImageRowImageRowImageRowImageRowimageRow (input_object)  image objectHImageHImageHImageXHobject (byte / direction / cyclic / int1)

Channel 2.

Histo2DimHisto2DimHisto2DimHisto2Dimhisto2Dim (output_object)  image objectHImageHImageHImageXHobject * (int4)

Histogram to be calculated.

Example (HDevelop)

read_image(Image,'monkey')
texture_laws(Image,Texture,'el',1,5)
draw_region(Region,WindowHandle)
histo_2dim(Region,Texture,Image,Histo2Dim)
disp_image(Histo2Dim,WindowHandle)

Example (C)

read_image(&Image,"monkey");
texture_laws(Image,&Texture,"el",1,5);
draw_region(&Region,WindowHandle);
histo_2dim(Region,Texture,Image,&Histo2Dim);
set_part(WindowHandle,0,0,255,255);
disp_image(Histo2Dim,WindowHandle);

Example (C++)

#include  "HalconCpp.h"
using namespace Halcon;
#include "HIOStream.h"
#if !defined(USE_IOSTREAM_H)
using namespace std;
#endif

main()
{
  HImage   img ("monkey");
  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);
}

Example (HDevelop)

read_image(Image,'monkey')
texture_laws(Image,Texture,'el',1,5)
draw_region(Region,WindowHandle)
histo_2dim(Region,Texture,Image,Histo2Dim)
disp_image(Histo2Dim,WindowHandle)

Example (HDevelop)

read_image(Image,'monkey')
texture_laws(Image,Texture,'el',1,5)
draw_region(Region,WindowHandle)
histo_2dim(Region,Texture,Image,Histo2Dim)
disp_image(Histo2Dim,WindowHandle)

Complexity

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

Result

The operator histo_2dimhisto_2dimhisto_2dimHisto2dimHisto2dim returns the value 2 (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>:)set_system("no_object_result",<Result>)set_system("no_object_result",<Result>)SetSystem("no_object_result",<Result>)SetSystem("no_object_result",<Result>), the behavior in case of empty region is set via set_system(::'empty_region_result',<Result>:)set_system("empty_region_result",<Result>)set_system("empty_region_result",<Result>)SetSystem("empty_region_result",<Result>)SetSystem("empty_region_result",<Result>). If necessary an exception is raised.

Possible Predecessors

decompose3decompose3decompose3Decompose3Decompose3, decompose2decompose2decompose2Decompose2Decompose2, draw_regiondraw_regiondraw_regionDrawRegionDrawRegion

Possible Successors

thresholdthresholdthresholdThresholdThreshold, class_2dim_supclass_2dim_supclass_2dim_supClass2dimSupClass2dimSup, pouringpouringpouringPouringPouring, local_maxlocal_maxlocal_maxLocalMaxLocalMax, gray_skeletongray_skeletongray_skeletonGraySkeletonGraySkeleton

Alternatives

gray_histogray_histogray_histoGrayHistoGrayHisto, gray_histo_absgray_histo_absgray_histo_absGrayHistoAbsGrayHistoAbs

See also

get_grayvalget_grayvalget_grayvalGetGrayvalGetGrayval

Module

Foundation


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