best_match T_best_match BestMatch BestMatch (Operator)
Name
best_match T_best_match BestMatch BestMatch
— Suche des besten Matching zwischen einem Template und einem Bild.
Warnung
best_match best_match BestMatch BestMatch BestMatch
ist veraltet und wird nur aus Gründen
der Rückwärtskompatibilität zur Verfügung gestellt. Neue
Applikationen sollten stattdessen die
Form-basierten oder NCC-basierten Operatoren verwenden.
Signatur
void BestMatch (const HObject& Image , const HTuple& TemplateID , const HTuple& MaxError , const HTuple& SubPixel , HTuple* Row , HTuple* Column , HTuple* Error )
void HTemplate ::BestMatch (const HImage& Image , double MaxError , const HString& SubPixel , HTuple* Row , HTuple* Column , HTuple* Error ) const
void HTemplate ::BestMatch (const HImage& Image , double MaxError , const HString& SubPixel , double* Row , double* Column , double* Error ) const
void HTemplate ::BestMatch (const HImage& Image , double MaxError , const char* SubPixel , double* Row , double* Column , double* Error ) const
void HTemplate ::BestMatch (const HImage& Image , double MaxError , const wchar_t* SubPixel , double* Row , double* Column , double* Error ) const
(Nur Windows)
void HImage ::BestMatch (const HTemplate& TemplateID , double MaxError , const HString& SubPixel , HTuple* Row , HTuple* Column , HTuple* Error ) const
void HImage ::BestMatch (const HTemplate& TemplateID , double MaxError , const HString& SubPixel , double* Row , double* Column , double* Error ) const
void HImage ::BestMatch (const HTemplate& TemplateID , double MaxError , const char* SubPixel , double* Row , double* Column , double* Error ) const
void HImage ::BestMatch (const HTemplate& TemplateID , double MaxError , const wchar_t* SubPixel , double* Row , double* Column , double* Error ) const
(Nur Windows)
static void HOperatorSet .BestMatch (HObject image , HTuple templateID , HTuple maxError , HTuple subPixel , out HTuple row , out HTuple column , out HTuple error )
void HTemplate .BestMatch (HImage image , double maxError , string subPixel , out HTuple row , out HTuple column , out HTuple error )
void HTemplate .BestMatch (HImage image , double maxError , string subPixel , out double row , out double column , out double error )
void HImage .BestMatch (HTemplate templateID , double maxError , string subPixel , out HTuple row , out HTuple column , out HTuple error )
void HImage .BestMatch (HTemplate templateID , double maxError , string subPixel , out double row , out double column , out double error )
Beschreibung
best_match best_match BestMatch BestMatch BestMatch
führt ein Matching zwischen dem Template von
TemplateID TemplateID TemplateID TemplateID templateID
und Image Image Image Image image
durch.
Dabei wird das Template so über die Punkte von
Image Image Image Image image
geschoben, dass es immer vollständig innerhalb von
Image Image Image Image image
liegt.
best_match best_match BestMatch BestMatch BestMatch
arbeitet ähnlich wie fast_match fast_match FastMatch FastMatch FastMatch
mit der
Erweiterung, dass jedesmal wenn eine Position mit einem geringeren
Matching-Fehler gefunden wurde, der Parameter MaxError MaxError MaxError MaxError maxError
intern entsprechend angepasst (d.h. verkleinert) wird,
um die Rechenzeit zu verkürzen.
Abhängig vom Parameter SubPixel SubPixel SubPixel SubPixel subPixel
wird die
Position in Subpixelgenauigkeit ausgegeben.
Das Matching-Kriterium („displaced frame difference“)
ist wie folgt definiert:
Die Laufzeit des Verfahrens hängt von der Größe des Definitionsbereiches
von Image Image Image Image image
ab.
Es ist daher wichtig, den Definitionsbereich
möglichst einzugrenzen,
d.h. den Operator nur in einer möglichst eng umrissenen
„region of interest“ anzuwenden.
Der Parameter MaxError MaxError MaxError MaxError maxError
legt den maximalen Fehler fest,
den die gesuchte Position haben darf.
Um so kleiner dieser Wert ist, um so schneller läuft das Verfahren.
Row Row Row Row row
und Column Column Column Column column
liefern die Position des
Best-Match, wobei Error Error Error Error error
die mittlere Abweichung der Grauwerte
angiebt.
Falls keine Position mit einem Fehler unter MaxError MaxError MaxError MaxError maxError
gefunden wurde, wird die Position (0,0) und ein
Matching-Fehler von 255 für Error Error Error Error error
geliefert.
In diesem Fall müs der Wert für MaxError MaxError MaxError MaxError maxError
größer
gewählt werden.
Der maximale Fehler der Position (ohne Rauschen) beträgt im sub-Pixel Modus
0.1 Pixel. Der mittlere Fehler betra"gt 0.03 Pixel.
Ausführungsinformationen
Multithreading-Typ: reentrant (läuft parallel zu nicht-exklusiven Operatoren).
Multithreading-Bereich: global (kann von jedem Thread aufgerufen werden).
Automatisch parallelisiert auf Tupelebene.
Parameter
Image Image Image Image image
(input_object) singlechannelimage(-array) →
object HImage HImage Hobject (byte)
Eingabebild, in dem das Pattern gefunden werden soll.
TemplateID TemplateID TemplateID TemplateID templateID
(input_control) template →
HTemplate , HTuple HTuple Htuple (handle) (IntPtr ) (HHandle ) (handle )
Nummer des Templates.
MaxError MaxError MaxError MaxError maxError
(input_control) real →
HTuple HTuple Htuple (real) (double ) (double ) (double )
Maximale mittlere Differenz der Grauwerte.
Defaultwert: 20.0
Wertevorschläge: 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 9.0, 11.0, 15.0, 17.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0
Typischer Wertebereich: 0
≤
MaxError
MaxError
MaxError
MaxError
maxError
≤
255
Minimale Schrittweite: 1
Empfohlene Schrittweite: 3
SubPixel SubPixel SubPixel SubPixel subPixel
(input_control) string →
HTuple HTuple Htuple (string) (string ) (HString ) (char* )
Subpixel Genauigkeit falls 'true' "true" "true" "true" "true" .
Defaultwert:
'false'
"false"
"false"
"false"
"false"
Werteliste: 'false' "false" "false" "false" "false" , 'true' "true" "true" "true" "true"
Row Row Row Row row
(output_control) point.y(-array) →
HTuple HTuple Htuple (real) (double ) (double ) (double )
Zeilenposition des Best-Match.
Column Column Column Column column
(output_control) point.x(-array) →
HTuple HTuple Htuple (real) (double ) (double ) (double )
Spaltenposition des Best-Match.
Error Error Error Error error
(output_control) real(-array) →
HTuple HTuple Htuple (real) (double ) (double ) (double )
Mittlere Abweichung der Grauwerte des Best-Match.
Ergebnis
Sind die Parameterwerte korrekt, dann liefert best_match best_match BestMatch BestMatch BestMatch
den Wert 2 (H_MSG_TRUE).
Das Verhalten bei leerer Eingabe (keine Eingabebilder vorhanden) lässt
sich mittels 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>)
festlegen. Gegebenenfalls wird eine Fehlerbehandlung durchgeführt.
Vorgänger
create_template create_template CreateTemplate CreateTemplate CreateTemplate
,
read_template read_template ReadTemplate ReadTemplate ReadTemplate
,
set_offset_template set_offset_template SetOffsetTemplate SetOffsetTemplate SetOffsetTemplate
,
set_reference_template set_reference_template SetReferenceTemplate SetReferenceTemplate SetReferenceTemplate
,
adapt_template adapt_template AdaptTemplate AdaptTemplate AdaptTemplate
,
draw_region draw_region DrawRegion DrawRegion DrawRegion
,
draw_rectangle1 draw_rectangle1 DrawRectangle1 DrawRectangle1 DrawRectangle1
,
reduce_domain reduce_domain ReduceDomain ReduceDomain ReduceDomain
Alternativen
fast_match fast_match FastMatch FastMatch FastMatch
,
fast_match_mg fast_match_mg FastMatchMg FastMatchMg FastMatchMg
,
best_match_mg best_match_mg BestMatchMg BestMatchMg BestMatchMg
,
best_match_pre_mg best_match_pre_mg BestMatchPreMg BestMatchPreMg BestMatchPreMg
,
best_match_rot best_match_rot BestMatchRot BestMatchRot BestMatchRot
,
best_match_rot_mg best_match_rot_mg BestMatchRotMg BestMatchRotMg BestMatchRotMg
,
exhaustive_match exhaustive_match ExhaustiveMatch ExhaustiveMatch ExhaustiveMatch
,
exhaustive_match_mg exhaustive_match_mg ExhaustiveMatchMg ExhaustiveMatchMg ExhaustiveMatchMg
Modul
Matching