gray_histoT_gray_histoGrayHistoGrayHisto (Operator)

Name

gray_histoT_gray_histoGrayHistoGrayHisto — Verteilung der Grauwerte.

Signatur

gray_histo(Regions, Image : : : AbsoluteHisto, RelativeHisto)

Herror T_gray_histo(const Hobject Regions, const Hobject Image, Htuple* AbsoluteHisto, Htuple* RelativeHisto)

void GrayHisto(const HObject& Regions, const HObject& Image, HTuple* AbsoluteHisto, HTuple* RelativeHisto)

HTuple HImage::GrayHisto(const HRegion& Regions, HTuple* RelativeHisto) const

HTuple HRegion::GrayHisto(const HImage& Image, HTuple* RelativeHisto) const

static void HOperatorSet.GrayHisto(HObject regions, HObject image, out HTuple absoluteHisto, out HTuple relativeHisto)

HTuple HImage.GrayHisto(HRegion regions, out HTuple relativeHisto)

HTuple HRegion.GrayHisto(HImage image, out HTuple relativeHisto)

Beschreibung

gray_histogray_histoGrayHistoGrayHistoGrayHisto berechnet für das übergebene Bild (ImageImageImageImageimage) innerhalb von RegionsRegionsRegionsRegionsregions das absolute (AbsoluteHistoAbsoluteHistoAbsoluteHistoAbsoluteHistoabsoluteHisto) und relative (RelativeHistoRelativeHistoRelativeHistoRelativeHistorelativeHisto) Histogramm der Grauwerte.

Beide Histogramme sind Tupel von 256 Werten, die (beginnend mit 0) die Häufigkeiten der einzelnen Grauwerte im Bild enthalten.

AbsoluteHistoAbsoluteHistoAbsoluteHistoAbsoluteHistoabsoluteHisto gibt dabei die absoluten Häufigkeiten der Grauwerte durch ganze Zahlen an, RelativeHistoRelativeHistoRelativeHistoRelativeHistorelativeHisto die relativen, d.h. die absoluten Häufigkeiten dividiert durch die Fläche des Bildes, als Gleitpunktzahlen.

'real'"real""real""real""real"- 'int2'"int2""int2""int2""int2"-, 'uint2'"uint2""uint2""uint2""uint2"- und 'int4'"int4""int4""int4""int4"-Bilder werden in 'byte'"byte""byte""byte""byte"-Bilder umgewandelt (zuerst wird der größte und der kleinste Grauwert im Bild bestimmt und anschließend werden die Originalgrauwerte linear in den Bereich 0..255 abgebildet) und dann wie oben verarbeitet. Mit set_paint(::WindowHandle,'histogram':)set_paint(WindowHandle,"histogram")SetPaint(WindowHandle,"histogram")SetPaint(WindowHandle,"histogram")SetPaint(WindowHandle,"histogram") und disp_imagedisp_imageDispImageDispImageDispImage kann das Histogramm auch direkt als Graphik ausgegeben werden.

Achtung

Der Operator gray_histogray_histoGrayHistoGrayHistoGrayHisto berücksichtigt nur die mittels RegionsRegionsRegionsRegionsregions übergebenen Regionen und ignoriert jede Domäne, die zuvor für das Eingabebild ImageImageImageImageimage festgelegt wurde.

real-, int2, uint2 und int4-Bilder werden auf 256 Grauwerte reduziert.

Für byte-, int1-, direction- und cyclic-Bilder kann gray_histogray_histoGrayHistoGrayHistoGrayHisto auf OpenCL Geräten ausgeführt werden, sofern das Gerät die in OpenCL 1.0 optionalen Erweiterungen cl_khr_local_int32_base_atomics und cl_khr_global_int32_base_atomics unterstützt. Im Gegensatz zu den meisten anderen HALCON Operatoren kann gray_histogray_histoGrayHistoGrayHistoGrayHisto auf OpenCL Geräten deutlich langsamer laufen, wenn das Bild ImageImageImageImageimage sich nicht komplett innerhalb der Regionen RegionsRegionsRegionsRegionsregions befindet.

In HALCON XL ist keine Ausführung mit OpenCL möglich, da atomare 64-Bit-Festkommaarithmetik erforderlich wäre.

Ausführungsinformationen

Parameter

RegionsRegionsRegionsRegionsregions (input_object)  region(-array) objectHRegionHRegionHobject

Region, in der das Histogramm berechnet werden soll.

ImageImageImageImageimage (input_object)  singlechannelimage objectHImageHImageHobject (byte* / cyclic* / direction* / int1* / int2 / uint2 / int4 / real) *erlaubt für Compute Devices

Bild, dessen Grauwertverteilung berechnet werden soll.

AbsoluteHistoAbsoluteHistoAbsoluteHistoAbsoluteHistoabsoluteHisto (output_control)  histogram-array HTupleHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Absolute Häufigkeiten der Grauwerte.

RelativeHistoRelativeHistoRelativeHistoRelativeHistorelativeHisto (output_control)  histogram-array HTupleHTupleHtuple (real) (double) (double) (double)

Häufigkeiten, normiert auf die Fläche der Region.

Komplexität

Sei F die Fläche der Region, dann beträgt die Laufzeitkomplexität O(F + 255).

Ergebnis

gray_histogray_histoGrayHistoGrayHistoGrayHisto liefert den Wert 2 (H_MSG_TRUE), falls das Bild definierte Grauwerte hat und die Parameter korrekt sind. Das Verhalten bei leerer Eingabe (keine Eingabebilder) wird mit set_system(::'no_object_result',<Result>:)set_system("no_object_result",<Result>)SetSystem("no_object_result",<Result>)SetSystem("no_object_result",<Result>)SetSystem("no_object_result",<Result>), das bei leerer Region mit set_system(::'empty_region_result',<Result>:)set_system("empty_region_result",<Result>)SetSystem("empty_region_result",<Result>)SetSystem("empty_region_result",<Result>)SetSystem("empty_region_result",<Result>) festgelegt. Gegebenenfalls wird eine Fehlerbehandlung durchgeführt.

Nachfolger

histo_to_threshhisto_to_threshHistoToThreshHistoToThreshHistoToThresh, gen_region_histogen_region_histoGenRegionHistoGenRegionHistoGenRegionHisto

Alternativen

min_max_graymin_max_grayMinMaxGrayMinMaxGrayMinMaxGray, intensityintensityIntensityIntensityIntensity, gray_histo_absgray_histo_absGrayHistoAbsGrayHistoAbsGrayHistoAbs, gray_histo_rangegray_histo_rangeGrayHistoRangeGrayHistoRangeGrayHistoRange

Siehe auch

set_paintset_paintSetPaintSetPaintSetPaint, disp_imagedisp_imageDispImageDispImageDispImage, histo_2dimhisto_2dimHisto2dimHisto2dimHisto2dim, scale_image_maxscale_image_maxScaleImageMaxScaleImageMaxScaleImageMax, entropy_grayentropy_grayEntropyGrayEntropyGrayEntropyGray

Modul

Foundation