measure_pairsT_measure_pairsMeasurePairsMeasurePairsmeasure_pairs (Operator)

Name

measure_pairsT_measure_pairsMeasurePairsMeasurePairsmeasure_pairs — Extraktion geradliniger Kantenpaare senkrecht zu einem Rechteck oder Kreisringsegment.

Signatur

measure_pairs(Image : : MeasureHandle, Sigma, Threshold, Transition, Select : RowEdgeFirst, ColumnEdgeFirst, AmplitudeFirst, RowEdgeSecond, ColumnEdgeSecond, AmplitudeSecond, IntraDistance, InterDistance)

Herror T_measure_pairs(const Hobject Image, const Htuple MeasureHandle, const Htuple Sigma, const Htuple Threshold, const Htuple Transition, const Htuple Select, Htuple* RowEdgeFirst, Htuple* ColumnEdgeFirst, Htuple* AmplitudeFirst, Htuple* RowEdgeSecond, Htuple* ColumnEdgeSecond, Htuple* AmplitudeSecond, Htuple* IntraDistance, Htuple* InterDistance)

void MeasurePairs(const HObject& Image, const HTuple& MeasureHandle, const HTuple& Sigma, const HTuple& Threshold, const HTuple& Transition, const HTuple& Select, HTuple* RowEdgeFirst, HTuple* ColumnEdgeFirst, HTuple* AmplitudeFirst, HTuple* RowEdgeSecond, HTuple* ColumnEdgeSecond, HTuple* AmplitudeSecond, HTuple* IntraDistance, HTuple* InterDistance)

void HMeasure::MeasurePairs(const HImage& Image, double Sigma, double Threshold, const HString& Transition, const HString& Select, HTuple* RowEdgeFirst, HTuple* ColumnEdgeFirst, HTuple* AmplitudeFirst, HTuple* RowEdgeSecond, HTuple* ColumnEdgeSecond, HTuple* AmplitudeSecond, HTuple* IntraDistance, HTuple* InterDistance) const

void HMeasure::MeasurePairs(const HImage& Image, double Sigma, double Threshold, const char* Transition, const char* Select, HTuple* RowEdgeFirst, HTuple* ColumnEdgeFirst, HTuple* AmplitudeFirst, HTuple* RowEdgeSecond, HTuple* ColumnEdgeSecond, HTuple* AmplitudeSecond, HTuple* IntraDistance, HTuple* InterDistance) const

void HMeasure::MeasurePairs(const HImage& Image, double Sigma, double Threshold, const wchar_t* Transition, const wchar_t* Select, HTuple* RowEdgeFirst, HTuple* ColumnEdgeFirst, HTuple* AmplitudeFirst, HTuple* RowEdgeSecond, HTuple* ColumnEdgeSecond, HTuple* AmplitudeSecond, HTuple* IntraDistance, HTuple* InterDistance) const   (Nur Windows)

void HImage::MeasurePairs(const HMeasure& MeasureHandle, double Sigma, double Threshold, const HString& Transition, const HString& Select, HTuple* RowEdgeFirst, HTuple* ColumnEdgeFirst, HTuple* AmplitudeFirst, HTuple* RowEdgeSecond, HTuple* ColumnEdgeSecond, HTuple* AmplitudeSecond, HTuple* IntraDistance, HTuple* InterDistance) const

void HImage::MeasurePairs(const HMeasure& MeasureHandle, double Sigma, double Threshold, const char* Transition, const char* Select, HTuple* RowEdgeFirst, HTuple* ColumnEdgeFirst, HTuple* AmplitudeFirst, HTuple* RowEdgeSecond, HTuple* ColumnEdgeSecond, HTuple* AmplitudeSecond, HTuple* IntraDistance, HTuple* InterDistance) const

void HImage::MeasurePairs(const HMeasure& MeasureHandle, double Sigma, double Threshold, const wchar_t* Transition, const wchar_t* Select, HTuple* RowEdgeFirst, HTuple* ColumnEdgeFirst, HTuple* AmplitudeFirst, HTuple* RowEdgeSecond, HTuple* ColumnEdgeSecond, HTuple* AmplitudeSecond, HTuple* IntraDistance, HTuple* InterDistance) const   (Nur Windows)

static void HOperatorSet.MeasurePairs(HObject image, HTuple measureHandle, HTuple sigma, HTuple threshold, HTuple transition, HTuple select, out HTuple rowEdgeFirst, out HTuple columnEdgeFirst, out HTuple amplitudeFirst, out HTuple rowEdgeSecond, out HTuple columnEdgeSecond, out HTuple amplitudeSecond, out HTuple intraDistance, out HTuple interDistance)

void HMeasure.MeasurePairs(HImage image, double sigma, double threshold, string transition, string select, out HTuple rowEdgeFirst, out HTuple columnEdgeFirst, out HTuple amplitudeFirst, out HTuple rowEdgeSecond, out HTuple columnEdgeSecond, out HTuple amplitudeSecond, out HTuple intraDistance, out HTuple interDistance)

void HImage.MeasurePairs(HMeasure measureHandle, double sigma, double threshold, string transition, string select, out HTuple rowEdgeFirst, out HTuple columnEdgeFirst, out HTuple amplitudeFirst, out HTuple rowEdgeSecond, out HTuple columnEdgeSecond, out HTuple amplitudeSecond, out HTuple intraDistance, out HTuple interDistance)

def measure_pairs(image: HObject, measure_handle: HHandle, sigma: float, threshold: float, transition: str, select: str) -> Tuple[Sequence[float], Sequence[float], Sequence[float], Sequence[float], Sequence[float], Sequence[float], Sequence[float], Sequence[float]]

Beschreibung

measure_pairsmeasure_pairsMeasurePairsMeasurePairsMeasurePairsmeasure_pairs dient zur Extraktion von geradlinigen Kantenpaaren, die senkrecht zur Hauptachse eines Rechtecks oder zu einem Kreisringsegment liegen.

Das Konzept der 1D-Vermessung ist bei der Einleitung zu Kapitel 1D-Vermessung beschrieben.

Der Algorithmus von measure_pairsmeasure_pairsMeasurePairsMeasurePairsMeasurePairsmeasure_pairs arbeitet analog zu measure_posmeasure_posMeasurePosMeasurePosMeasurePosmeasure_pos. Die Kanten werden jedoch zu Paaren mit unterschiedlichen Kantenübergängen (Vorzeichen) zusammengefasst. Falls TransitionTransitionTransitionTransitiontransitiontransition = 'positive'"positive""positive""positive""positive""positive" werden in RowEdgeFirstRowEdgeFirstRowEdgeFirstRowEdgeFirstrowEdgeFirstrow_edge_first und ColumnEdgeFirstColumnEdgeFirstColumnEdgeFirstColumnEdgeFirstcolumnEdgeFirstcolumn_edge_first Kantenpunkte mit Übergang von Dunkel nach Hell und in RowEdgeSecondRowEdgeSecondRowEdgeSecondRowEdgeSecondrowEdgeSecondrow_edge_second und ColumnEdgeSecondColumnEdgeSecondColumnEdgeSecondColumnEdgeSecondcolumnEdgeSecondcolumn_edge_second mit Übergang von Hell nach Dunkel übergeben. Im Modus 'negative'"negative""negative""negative""negative""negative" ist dies genau umgekehrt. Im Modus 'all'"all""all""all""all""all" bestimmt die jeweils erste gefundene Kante die Art der Paarbildung. D.h., je nach Lage des Messobjekts werden entweder hell-dunkel-hell Übergänge oder dunkel-hell-dunkel Übergänge gefunden. Dieses Vorgehen ist dann nützlich, wenn z.B. Objekte vermessen werden, die unterschiedliche Helligkeiten in Relation zum Hintergrund aufweisen.

Treten Kanten mit gleichen Vorzeichen mehrfach hintereinander auf, so wird jeweils die erste Kante der Folge zur Paarbildung verwendet. Dies kann in Anwendungen problematisch sein, in denen der Schwellenwert ThresholdThresholdThresholdThresholdthresholdthreshold nicht so groß gewählt werden kann, dass aufeinanderfolgende Kanten gleichen Vorzeichens über den Schwellenwert eliminiert werden. Daher gibt es zu jedem der oben genannten Modi einen zweiten Modus, der nur die jeweils stärksten aufeinanderfolgenden aufsteigenden und absteigenden Kanten selektiert. Dieser Modus wird selektiert, indem an den jeweiligen Modus in TransitionTransitionTransitionTransitiontransitiontransition der String '_strongest'"_strongest""_strongest""_strongest""_strongest""_strongest" angehängt wird, also z.B. 'negative_strongest'"negative_strongest""negative_strongest""negative_strongest""negative_strongest""negative_strongest". Schließlich kann gewählt werden, welche der extrahierten Kantenpaare zurückgeliefert werden sollen. Wenn SelectSelectSelectSelectselectselect auf 'all'"all""all""all""all""all" gesetzt wird, werden alle gefundenen Paare zurückgegeben, falls SelectSelectSelectSelectselectselect auf 'first'"first""first""first""first""first" gesetzt wird nur das erste Kantenpaar und falls SelectSelectSelectSelectselectselect auf 'last'"last""last""last""last""last" gesetzt wird nur das letzte.

Die extrahierten Kanten werden als einzelne Punkte, die auf der Hauptachse des Rechtecks oder auf dem mittleren Bogen des Kreisringsegments liegen, zurückgegeben. Die zugehörigen Kantenamplituden werden in AmplitudeFirstAmplitudeFirstAmplitudeFirstAmplitudeFirstamplitudeFirstamplitude_first und AmplitudeSecondAmplitudeSecondAmplitudeSecondAmplitudeSecondamplitudeSecondamplitude_second zurückgeliefert. Zusätzlich wird noch der Abstand innerhalb eines Kantenpaares in IntraDistanceIntraDistanceIntraDistanceIntraDistanceintraDistanceintra_distance und der Abstand von aufeinanderfolgenden Kantenpaaren in InterDistanceInterDistanceInterDistanceInterDistanceinterDistanceinter_distance zurückgeliefert. Dabei entspricht IntraDistance[i] dem Abstand von EdgeFirst[i] und EdgeSecond[i], während InterDistance[i] dem Abstand von EdgeSecond[i] und EdgeFirst[i+1] entspricht. D.h., das Tupel InterDistanceInterDistanceInterDistanceInterDistanceinterDistanceinter_distance enthält ein Element weniger als die Tupel der Kantenpaare.

Achtung

measure_pairsmeasure_pairsMeasurePairsMeasurePairsMeasurePairsmeasure_pairs liefert nur dann brauchbare Ergebnisse, falls die Annahme, dass die Kanten gerade und senkrecht zur Hauptachse des Rechtecks oder zum Kreisringsegment sind, erfüllt ist. measure_pairsmeasure_pairsMeasurePairsMeasurePairsMeasurePairsmeasure_pairs sollte daher z.B. nicht dazu verwendet werden, Kanten von gekrümmten Objekten zu extrahieren. Weiterhin sollte der Benutzer darauf achten, dass das Rechteck / das Kreisringsegment möglichst senkrecht zu den Bildkanten liegt. Außerdem darf SigmaSigmaSigmaSigmasigmasigma nicht größer als ca. 0.5 * Length1 (siehe gen_measure_rectangle2gen_measure_rectangle2GenMeasureRectangle2GenMeasureRectangle2GenMeasureRectangle2gen_measure_rectangle2 für Length1) sein.

Es ist zu beachten, dass measure_pairsmeasure_pairsMeasurePairsMeasurePairsMeasurePairsmeasure_pairs den Definitionsbereich von ImageImageImageImageimageimage aus Geschwindigkeitsgründen ignoriert. Falls bestimmte Bildbereiche von der Messung ausgeschlossen werden sollen, sollte ein neues Messobjekt mit entsprechend angepassten Parametern erzeugt werden.

Ausführungsinformationen

Parameter

ImageImageImageImageimageimage (input_object)  singlechannelimage objectHImageHObjectHImageHobject (byte / uint2 / real)

Eingabebild.

MeasureHandleMeasureHandleMeasureHandleMeasureHandlemeasureHandlemeasure_handle (input_control)  measure HMeasure, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

Handle des Messobjekts.

SigmaSigmaSigmaSigmasigmasigma (input_control)  number HTuplefloatHTupleHtuple (real) (double) (double) (double)

Sigma der Gaußglättung.

Defaultwert: 1.0

Wertevorschläge: 0.4, 0.6, 0.8, 1.0, 1.5, 2.0, 3.0, 4.0, 5.0, 7.0, 10.0

Typischer Wertebereich: 0.4 ≤ Sigma Sigma Sigma Sigma sigma sigma ≤ 100 (lin)

Minimale Schrittweite: 0.01

Empfohlene Schrittweite: 0.1

ThresholdThresholdThresholdThresholdthresholdthreshold (input_control)  number HTuplefloatHTupleHtuple (real) (double) (double) (double)

Minimale Amplitude einer Kante.

Defaultwert: 30.0

Wertevorschläge: 5.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 90.0, 110.0

Typischer Wertebereich: 1 ≤ Threshold Threshold Threshold Threshold threshold threshold ≤ 255 (lin)

Minimale Schrittweite: 0.5

Empfohlene Schrittweite: 2

TransitionTransitionTransitionTransitiontransitiontransition (input_control)  string HTuplestrHTupleHtuple (string) (string) (HString) (char*)

Auswahl des Grauwertüberganges, der zur Paarbildung verwendet wird.

Defaultwert: 'all' "all" "all" "all" "all" "all"

Werteliste: 'all'"all""all""all""all""all", 'all_strongest'"all_strongest""all_strongest""all_strongest""all_strongest""all_strongest", 'negative'"negative""negative""negative""negative""negative", 'negative_strongest'"negative_strongest""negative_strongest""negative_strongest""negative_strongest""negative_strongest", 'positive'"positive""positive""positive""positive""positive", 'positive_strongest'"positive_strongest""positive_strongest""positive_strongest""positive_strongest""positive_strongest"

SelectSelectSelectSelectselectselect (input_control)  string HTuplestrHTupleHtuple (string) (string) (HString) (char*)

Auswahl der Kantenpaare.

Defaultwert: 'all' "all" "all" "all" "all" "all"

Werteliste: 'all'"all""all""all""all""all", 'first'"first""first""first""first""first", 'last'"last""last""last""last""last"

RowEdgeFirstRowEdgeFirstRowEdgeFirstRowEdgeFirstrowEdgeFirstrow_edge_first (output_control)  point.y-array HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)

Zeilenkoordinate des Mittelpunktes der ersten Kante.

ColumnEdgeFirstColumnEdgeFirstColumnEdgeFirstColumnEdgeFirstcolumnEdgeFirstcolumn_edge_first (output_control)  point.x-array HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)

Spaltenkoordinate des Mittelpunktes der ersten Kante.

AmplitudeFirstAmplitudeFirstAmplitudeFirstAmplitudeFirstamplitudeFirstamplitude_first (output_control)  real-array HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)

Kantenamplitude der ersten Kante (mit Vorzeichen).

RowEdgeSecondRowEdgeSecondRowEdgeSecondRowEdgeSecondrowEdgeSecondrow_edge_second (output_control)  point.y-array HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)

Zeilenkoordinate des Mittelpunktes der zweiten Kante.

ColumnEdgeSecondColumnEdgeSecondColumnEdgeSecondColumnEdgeSecondcolumnEdgeSecondcolumn_edge_second (output_control)  point.x-array HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)

Spaltenkoordinate des Mittelpunktes der zweiten Kante.

AmplitudeSecondAmplitudeSecondAmplitudeSecondAmplitudeSecondamplitudeSecondamplitude_second (output_control)  real-array HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)

Kantenamplitude der zweiten Kante (mit Vorzeichen).

IntraDistanceIntraDistanceIntraDistanceIntraDistanceintraDistanceintra_distance (output_control)  real-array HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)

Abstand zwischen Kanten eines Kantenpaars.

InterDistanceInterDistanceInterDistanceInterDistanceinterDistanceinter_distance (output_control)  real-array HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)

Abstand zwischen aufeinanderfolgenden Kantenpaaren.

Ergebnis

Sind die Parameterwerte korrekt, dann liefert measure_pairsmeasure_pairsMeasurePairsMeasurePairsMeasurePairsmeasure_pairs den Wert 2 (H_MSG_TRUE). Andernfalls wird eine Fehlerbehandlung durchgeführt.

Vorgänger

gen_measure_rectangle2gen_measure_rectangle2GenMeasureRectangle2GenMeasureRectangle2GenMeasureRectangle2gen_measure_rectangle2

Nachfolger

close_measureclose_measureCloseMeasureCloseMeasureCloseMeasureclose_measure

Alternativen

edges_sub_pixedges_sub_pixEdgesSubPixEdgesSubPixEdgesSubPixedges_sub_pix, fuzzy_measure_pairsfuzzy_measure_pairsFuzzyMeasurePairsFuzzyMeasurePairsFuzzyMeasurePairsfuzzy_measure_pairs, fuzzy_measure_pairingfuzzy_measure_pairingFuzzyMeasurePairingFuzzyMeasurePairingFuzzyMeasurePairingfuzzy_measure_pairing

Siehe auch

measure_posmeasure_posMeasurePosMeasurePosMeasurePosmeasure_pos, fuzzy_measure_posfuzzy_measure_posFuzzyMeasurePosFuzzyMeasurePosFuzzyMeasurePosfuzzy_measure_pos

Modul

1D Metrology