histo_to_threshT_histo_to_threshHistoToThreshHistoToThresh (Operator)

Name

histo_to_threshT_histo_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)

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

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

Beschreibung

histo_to_threshhisto_to_threshHistoToThreshHistoToThreshHistoToThresh berechnet aus einem Histogramm Schwellen für eine Segmentation mit thresholdthresholdThresholdThresholdThreshold. 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_threshHistoToThreshHistoToThreshHistoToThresh kann die mit gray_histogray_histoGrayHistoGrayHistoGrayHisto 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_absGrayHistoAbsGrayHistoAbsGrayHistoAbs 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 SigmaSigmaSigmaSigmasigma extrem groß gewählt werden, was zu sehr hohen Laufzeiten und numerischen Problemen führen würde. Die Quantisierung in gray_histo_absgray_histo_absGrayHistoAbsGrayHistoAbsGrayHistoAbs 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_absGrayHistoAbsGrayHistoAbsGrayHistoAbs 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_threshHistoToThreshHistoToThreshHistoToThresh ausgewählt werden. Schließlich muss MinThreshMinThreshMinThreshMinThreshminThresh noch mit 4 (der Quantisierung) multipliziert werden, während MaxThreshMaxThreshMaxThreshMaxThreshmaxThresh mit 4 multipliziert und um 3 (der Quantisierung minus 1) erhöht werden muss.

Ausführungsinformationen

Parameter

HistogrammHistogrammHistogrammHistogrammhistogramm (input_control)  histogram-array HTupleHTupleHtuple (integer / real) (int / long / double) (Hlong / double) (Hlong / double)

Grauwerthistogramm.

SigmaSigmaSigmaSigmasigma (input_control)  number HTupleHTupleHtuple (real) (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 ≤ 30.0 (lin)

Minimale Schrittweite: 0.01

Empfohlene Schrittweite: 0.2

MinThreshMinThreshMinThreshMinThreshminThresh (output_control)  integer-array HTupleHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Minimale Schwellen.

MaxThreshMaxThreshMaxThreshMaxThreshmaxThresh (output_control)  integer-array HTupleHTupleHtuple (integer) (int / long) (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_histoGrayHistoGrayHistoGrayHisto

Nachfolger

thresholdthresholdThresholdThresholdThreshold

Siehe auch

auto_thresholdauto_thresholdAutoThresholdAutoThresholdAutoThreshold, binary_thresholdbinary_thresholdBinaryThresholdBinaryThresholdBinaryThreshold, char_thresholdchar_thresholdCharThresholdCharThresholdCharThreshold

Modul

Foundation