KlassenKlassenKlassenKlassen | | | | Operatoren

histo_to_threshT_histo_to_threshHistoToThreshhisto_to_threshHistoToThreshHistoToThresh (Operator)

Name

histo_to_threshT_histo_to_threshHistoToThreshhisto_to_threshHistoToThreshHistoToThresh — Berechnen von Grauwertschwellen aus einem Histogramm.

Signatur

histo_to_thresh( : : Histogramm, Sigma : MinThresh, MaxThresh)

Herror T_histo_to_thresh(const Htuple Histogramm, const Htuple Sigma, Htuple* MinThresh, Htuple* MaxThresh)

Herror histo_to_thresh(const HTuple& Histogramm, const HTuple& Sigma, HTuple* MinThresh, HTuple* MaxThresh)

void HistoToThresh(const HTuple& Histogramm, const HTuple& Sigma, HTuple* MinThresh, HTuple* MaxThresh)

void HOperatorSetX.HistoToThresh(
[in] VARIANT Histogramm, [in] VARIANT Sigma, [out] VARIANT* MinThresh, [out] VARIANT* MaxThresh)

static void HOperatorSet.HistoToThresh(HTuple histogramm, HTuple sigma, out HTuple minThresh, out HTuple maxThresh)

Beschreibung

histo_to_threshhisto_to_threshHistoToThreshhisto_to_threshHistoToThreshHistoToThresh berechnet aus einem Histogramm Schwellen für eine Segmentation mit thresholdthresholdThresholdthresholdThresholdThreshold. Als Schwellen werden die Werte 0 und der Maximale Grauwert im Histogramm, sowie alle Minima des Histogramms verwendet. Vor der Berechnung der Schwellen wird das Histogramm mit einer Gaußfunktion geglättet.

histo_to_threshhisto_to_threshHistoToThreshhisto_to_threshHistoToThreshHistoToThresh kann die mit gray_histogray_histoGrayHistogray_histoGrayHistoGrayHisto erzeugten relativen und absoluten Histogramme verarbeiten. Allerdings sollten hierbei nur byte-Bilder verwendet werden, da sonst die zurückgelieferten Schwellen nicht ohne weiteres auf die entsprechenden Schwellen des Bildes umgerechnet werden können. Für die Bildtypen uint2 sollten die Histogramme mit gray_histo_absgray_histo_absGrayHistoAbsgray_histo_absGrayHistoAbsGrayHistoAbs berechnet werden, da dann die Umrechnung auf die Schwellen einfach durch Multiplikation mit der gewählten Quantisierung erfolgen kann. Bei uint2-Bildern ist zu beachten, dass die Quantisierung so gewählt werden sollte, dass das Histogramm noch aussagekräftige Information enthält. So hat z.B. ein 640 x 480 Bild mit 16 Bit Grauwertauflösung im Mittel nur 307200 / 65536 = 4.7 Einträge in jeder Histogrammzelle, d.h. das Histogramm ist zu dünn besetzt, um sinnvolle Statistiken daraus ableiten zu können. Um aus einem solchen Histogramm sinnvolle Schwellen extrahieren zu können, müsste SigmaSigmaSigmaSigmaSigmasigma extrem groß gewählt werden, was zu sehr hohen Laufzeiten und numerischen Problemen führen würde. Die Quantisierung in gray_histo_absgray_histo_absGrayHistoAbsgray_histo_absGrayHistoAbsGrayHistoAbs sollte im Normalfall also so gewählt werden, dass das Histogramm maximal 1024 Einträge enthält. Bei Bildern mit mehr als 10 Bit pro Pixel muss die Quantisierung also größer als 1 gewählt werden. Das mit gray_histo_absgray_histo_absGrayHistoAbsgray_histo_absGrayHistoAbsGrayHistoAbs berechnete Histogramm ist weiterhin auf die Teile zu beschränken, die signifikante Information tragen. So sollte z.B. bei einem Bild mit 12 Bit pro Pixel die Quantisierung auf 4 gesetzt werden. Von dem berechneten Histogramm (das in diesem Fall immer noch 16384 Werte enthält), sollten die ersten 1024 Werte als Eingabe für histo_to_threshhisto_to_threshHistoToThreshhisto_to_threshHistoToThreshHistoToThresh ausgewählt werden. Schließlich muss MinThreshMinThreshMinThreshMinThreshMinThreshminThresh noch mit 4 (der Quantisierung) multipliziert werden, während MaxThreshMaxThreshMaxThreshMaxThreshMaxThreshmaxThresh mit 4 multipliziert und um 3 (der Quantisierung minus 1) erhöht werden muss.

Parallelisierung

Parameter

HistogrammHistogrammHistogrammHistogrammHistogrammhistogramm (input_control)  histogram-array HTupleHTupleHTupleVARIANTHtuple (integer / real) (int / long / double) (Hlong / double) (Hlong / double) (Hlong / double) (Hlong / double)

Grauwerthistogramm.

SigmaSigmaSigmaSigmaSigmasigma (input_control)  number HTupleHTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double) (double)

Sigma für Glättung des Histogramms.

Defaultwert: 2.0

Wertevorschläge: 0.5, 1.0, 2.0, 3.0, 4.0, 5.0

Typischer Wertebereich: 0.5 ≤ Sigma Sigma Sigma Sigma Sigma sigma ≤ 30.0 (lin)

Minimale Schrittweite: 0.01

Empfohlene Schrittweite: 0.2

MinThreshMinThreshMinThreshMinThreshMinThreshminThresh (output_control)  integer-array HTupleHTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong) (Hlong)

Minimale Schwellen.

MaxThreshMaxThreshMaxThreshMaxThreshMaxThreshmaxThresh (output_control)  integer-array HTupleHTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong) (Hlong)

Maximale Schwellen.

Beispiel (HDevelop)

* Calculate thresholds from a byte image and threshold the image.
gray_histo (Image, Image, AbsoluteHisto, RelativeHisto)
histo_to_thresh (AbsoluteHisto, 4, MinThresh, MaxThresh)
threshold (Image, Region, MinThresh, MaxThresh)

* Calculate thresholds from a 12 bit uint2 image and threshold the image.
gray_histo_abs (Image, Image, 4, AbsoluteHisto)
AbsoluteHisto := AbsoluteHisto[0:1023]
histo_to_thresh (AbsoluteHisto, 16, MinThresh, MaxThresh)
MinThresh := MinThresh*4
MaxThresh := MaxThresh*4+3
threshold (Image, Region, MinThresh, MaxThresh)

Vorgänger

gray_histogray_histoGrayHistogray_histoGrayHistoGrayHisto

Nachfolger

thresholdthresholdThresholdthresholdThresholdThreshold

Siehe auch

auto_thresholdauto_thresholdAutoThresholdauto_thresholdAutoThresholdAutoThreshold, binary_thresholdbinary_thresholdBinaryThresholdbinary_thresholdBinaryThresholdBinaryThreshold, char_thresholdchar_thresholdCharThresholdchar_thresholdCharThresholdCharThreshold

Modul

Foundation


KlassenKlassenKlassenKlassen | | | | Operatoren