gray_histoT_gray_histoGrayHistoGrayHistogray_histo (Operator)

Name

gray_histoT_gray_histoGrayHistoGrayHistogray_histo — Verteilung der Grauwerte.

Signatur

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

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

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

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

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

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

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

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

def gray_histo(region: HObject, image: HObject) -> Tuple[Sequence[int], Sequence[float]]

Beschreibung

gray_histogray_histoGrayHistoGrayHistoGrayHistogray_histo berechnet für das übergebene Bild (ImageImageImageImageimageimage) innerhalb von RegionRegionRegionRegionregionregion das absolute (AbsoluteHistoAbsoluteHistoAbsoluteHistoAbsoluteHistoabsoluteHistoabsolute_histo) und relative (RelativeHistoRelativeHistoRelativeHistoRelativeHistorelativeHistorelative_histo) Histogramm der Grauwerte.

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

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

'real'"real""real""real""real""real"- 'int2'"int2""int2""int2""int2""int2"-, 'uint2'"uint2""uint2""uint2""uint2""uint2"- und 'int4'"int4""int4""int4""int4""int4"-Bilder werden in 'byte'"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.

Achtung

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

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

Für byte-, int1-, direction- und cyclic-Bilder kann gray_histogray_histoGrayHistoGrayHistoGrayHistogray_histo 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_histoGrayHistoGrayHistoGrayHistogray_histo auf OpenCL-Geräten deutlich langsamer laufen, wenn das Bild ImageImageImageImageimageimage sich nicht komplett innerhalb der Regionen RegionRegionRegionRegionregionregion befindet.

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

Ausführungsinformationen

Parameter

RegionRegionRegionRegionregionregion (input_object)  region objectHRegionHObjectHRegionHobject

Region, in der das Histogramm berechnet werden soll.

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

Bild, dessen Grauwertverteilung berechnet werden soll.

AbsoluteHistoAbsoluteHistoAbsoluteHistoAbsoluteHistoabsoluteHistoabsolute_histo (output_control)  histogram-array HTupleSequence[int]HTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Absolute Häufigkeiten der Grauwerte.

RelativeHistoRelativeHistoRelativeHistoRelativeHistorelativeHistorelative_histo (output_control)  histogram-array HTupleSequence[float]HTupleHtuple (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_histoGrayHistoGrayHistoGrayHistogray_histo 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>)set_system("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>)set_system("empty_region_result",<Result>) festgelegt. Gegebenenfalls wird eine Fehlerbehandlung durchgeführt.

Nachfolger

histo_to_threshhisto_to_threshHistoToThreshHistoToThreshHistoToThreshhisto_to_thresh, gen_region_histogen_region_histoGenRegionHistoGenRegionHistoGenRegionHistogen_region_histo

Alternativen

min_max_graymin_max_grayMinMaxGrayMinMaxGrayMinMaxGraymin_max_gray, intensityintensityIntensityIntensityIntensityintensity, gray_histo_absgray_histo_absGrayHistoAbsGrayHistoAbsGrayHistoAbsgray_histo_abs, gray_histo_rangegray_histo_rangeGrayHistoRangeGrayHistoRangeGrayHistoRangegray_histo_range

Siehe auch

set_paintset_paintSetPaintSetPaintSetPaintset_paint, histo_2dimhisto_2dimHisto2dimHisto2dimHisto2dimhisto_2dim, scale_image_maxscale_image_maxScaleImageMaxScaleImageMaxScaleImageMaxscale_image_max, entropy_grayentropy_grayEntropyGrayEntropyGrayEntropyGrayentropy_gray

Modul

Foundation