KlassenKlassenKlassenKlassen | | | | Operatoren

measure_pairsT_measure_pairsMeasurePairsmeasure_pairsMeasurePairsMeasurePairs (Operator)

Name

measure_pairsT_measure_pairsMeasurePairsmeasure_pairsMeasurePairsMeasurePairs — Extraktion geradliniger Kantenpaare senkrecht zu einem Rechteck oder Kreisring.

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)

Herror measure_pairs(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)

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

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

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 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 HOperatorSetX.MeasurePairs(
[in] IHUntypedObjectX* Image, [in] VARIANT MeasureHandle, [in] VARIANT Sigma, [in] VARIANT Threshold, [in] VARIANT Transition, [in] VARIANT Select, [out] VARIANT* RowEdgeFirst, [out] VARIANT* ColumnEdgeFirst, [out] VARIANT* AmplitudeFirst, [out] VARIANT* RowEdgeSecond, [out] VARIANT* ColumnEdgeSecond, [out] VARIANT* AmplitudeSecond, [out] VARIANT* IntraDistance, [out] VARIANT* InterDistance)

VARIANT HMeasureX.MeasurePairs(
[in] IHImageX* Image, [in] double Sigma, [in] double Threshold, [in] BSTR Transition, [in] BSTR Select, [out] VARIANT* ColumnEdgeFirst, [out] VARIANT* AmplitudeFirst, [out] VARIANT* RowEdgeSecond, [out] VARIANT* ColumnEdgeSecond, [out] VARIANT* AmplitudeSecond, [out] VARIANT* IntraDistance, [out] VARIANT* InterDistance)

VARIANT HImageX.MeasurePairs(
[in] IHMeasureX* MeasureHandle, [in] double Sigma, [in] double Threshold, [in] BSTR Transition, [in] BSTR Select, [out] VARIANT* ColumnEdgeFirst, [out] VARIANT* AmplitudeFirst, [out] VARIANT* RowEdgeSecond, [out] VARIANT* ColumnEdgeSecond, [out] VARIANT* AmplitudeSecond, [out] VARIANT* IntraDistance, [out] VARIANT* InterDistance)

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)

Beschreibung

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

Der Algorithmus arbeitet analog zu measure_posmeasure_posMeasurePosmeasure_posMeasurePosMeasurePos. Die Kanten werden jedoch zu Paaren mit unterschiedlichen Kantenübergängen (Vorzeichen) zusammengefasst. Falls TransitionTransitionTransitionTransitionTransitiontransition = 'positive'"positive""positive""positive""positive""positive" werden in RowEdgeFirstRowEdgeFirstRowEdgeFirstRowEdgeFirstRowEdgeFirstrowEdgeFirst und ColumnEdgeFirstColumnEdgeFirstColumnEdgeFirstColumnEdgeFirstColumnEdgeFirstcolumnEdgeFirst Kantenpunkte mit Übergang von Dunkel nach Hell und in RowEdgeSecondRowEdgeSecondRowEdgeSecondRowEdgeSecondRowEdgeSecondrowEdgeSecond und ColumnEdgeSecondColumnEdgeSecondColumnEdgeSecondColumnEdgeSecondColumnEdgeSecondcolumnEdgeSecond 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 gefunde 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 Schwellwert ThresholdThresholdThresholdThresholdThresholdthreshold nicht so groß gewählt werden kann, dass aufeinanderfolgende Kanten gleichen Vorzeichens über den Schwellwert 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 Kantepaar 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 Kreisrings liegen, zurückgegeben. Die zugehörigen Kantenamplituden werden in AmplitudeFirstAmplitudeFirstAmplitudeFirstAmplitudeFirstAmplitudeFirstamplitudeFirst und AmplitudeSecondAmplitudeSecondAmplitudeSecondAmplitudeSecondAmplitudeSecondamplitudeSecond zurückgeliefert. Zusätzlich wird noch der Abstand innerhalb eines Kantenpaares in IntraDistanceIntraDistanceIntraDistanceIntraDistanceIntraDistanceintraDistance und der Abstand von aufeinanderfolgenden Kantenpaaren in InterDistanceInterDistanceInterDistanceInterDistanceInterDistanceinterDistance 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 InterDistanceInterDistanceInterDistanceInterDistanceInterDistanceinterDistance enthält ein Element weniger als die Tupel der Kantenpaare.

Achtung

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

Es ist zu beachten, dass measure_pairsmeasure_pairsMeasurePairsmeasure_pairsMeasurePairsMeasurePairs 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.

Parallelisierung

Parameter

ImageImageImageImageImageimage (input_object)  singlechannelimage objectHImageHImageHImageHImageXHobject (byte / uint2 / real)

Eingabebild.

MeasureHandleMeasureHandleMeasureHandleMeasureHandleMeasureHandlemeasureHandle (input_control)  measure_id HMeasure, HTupleHTupleHMeasure, HTupleHMeasureX, VARIANTHtuple (integer) (IntPtr) (Hlong) (Hlong) (Hlong) (Hlong)

Handle des Messobjekts.

SigmaSigmaSigmaSigmaSigmasigma (input_control)  number HTupleHTupleHTupleVARIANTHtuple (real) (double) (double) (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

Restriktion: Sigma >= 0.4

ThresholdThresholdThresholdThresholdThresholdthreshold (input_control)  number HTupleHTupleHTupleVARIANTHtuple (real) (double) (double) (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 HTupleHTupleHTupleVARIANTHtuple (string) (string) (HString) (char*) (BSTR) (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 HTupleHTupleHTupleVARIANTHtuple (string) (string) (HString) (char*) (BSTR) (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"

RowEdgeFirstRowEdgeFirstRowEdgeFirstRowEdgeFirstRowEdgeFirstrowEdgeFirst (output_control)  point.y-array HTupleHTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double) (double)

Zeilenkoordinate des Mittelpunktes der ersten Kante.

ColumnEdgeFirstColumnEdgeFirstColumnEdgeFirstColumnEdgeFirstColumnEdgeFirstcolumnEdgeFirst (output_control)  point.x-array HTupleHTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double) (double)

Spaltenkoordinate des Mittelpunktes der ersten Kante.

AmplitudeFirstAmplitudeFirstAmplitudeFirstAmplitudeFirstAmplitudeFirstamplitudeFirst (output_control)  real-array HTupleHTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double) (double)

Kantenamplitude der ersten Kante (mit Vorzeichen).

RowEdgeSecondRowEdgeSecondRowEdgeSecondRowEdgeSecondRowEdgeSecondrowEdgeSecond (output_control)  point.y-array HTupleHTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double) (double)

Zeilenkoordinate des Mittelpunktes der zweiten Kante.

ColumnEdgeSecondColumnEdgeSecondColumnEdgeSecondColumnEdgeSecondColumnEdgeSecondcolumnEdgeSecond (output_control)  point.x-array HTupleHTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double) (double)

Spaltenkoordinate des Mittelpunktes der zweiten Kante.

AmplitudeSecondAmplitudeSecondAmplitudeSecondAmplitudeSecondAmplitudeSecondamplitudeSecond (output_control)  real-array HTupleHTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double) (double)

Kantenamplitude der zweiten Kante (mit Vorzeichen).

IntraDistanceIntraDistanceIntraDistanceIntraDistanceIntraDistanceintraDistance (output_control)  real-array HTupleHTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double) (double)

Abstand zwischen Kanten eines Kantenpaars.

InterDistanceInterDistanceInterDistanceInterDistanceInterDistanceinterDistance (output_control)  real-array HTupleHTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double) (double)

Abstand zwischen aufeinanderfolgenden Kantenpaaren.

Ergebnis

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

Vorgänger

gen_measure_rectangle2gen_measure_rectangle2GenMeasureRectangle2gen_measure_rectangle2GenMeasureRectangle2GenMeasureRectangle2

Nachfolger

close_measureclose_measureCloseMeasureclose_measureCloseMeasureCloseMeasure

Alternativen

edges_sub_pixedges_sub_pixEdgesSubPixedges_sub_pixEdgesSubPixEdgesSubPix, fuzzy_measure_pairsfuzzy_measure_pairsFuzzyMeasurePairsfuzzy_measure_pairsFuzzyMeasurePairsFuzzyMeasurePairs, fuzzy_measure_pairingfuzzy_measure_pairingFuzzyMeasurePairingfuzzy_measure_pairingFuzzyMeasurePairingFuzzyMeasurePairing

Siehe auch

measure_posmeasure_posMeasurePosmeasure_posMeasurePosMeasurePos, fuzzy_measure_posfuzzy_measure_posFuzzyMeasurePosfuzzy_measure_posFuzzyMeasurePosFuzzyMeasurePos

Modul

1D Metrology


KlassenKlassenKlassenKlassen | | | | Operatoren