find_uncalib_descriptor_modelT_find_uncalib_descriptor_modelFindUncalibDescriptorModelFindUncalibDescriptorModel (Operator)
Name
find_uncalib_descriptor_modelT_find_uncalib_descriptor_modelFindUncalibDescriptorModelFindUncalibDescriptorModel
— Suchen die besten Matches eines Deskriptormodells in einem Suchbild.
Signatur
Herror T_find_uncalib_descriptor_model(const Hobject Image, const Htuple ModelID, const Htuple DetectorParamName, const Htuple DetectorParamValue, const Htuple DescriptorParamName, const Htuple DescriptorParamValue, const Htuple MinScore, const Htuple NumMatches, const Htuple ScoreType, Htuple* HomMat2D, Htuple* Score)
void FindUncalibDescriptorModel(const HObject& Image, const HTuple& ModelID, const HTuple& DetectorParamName, const HTuple& DetectorParamValue, const HTuple& DescriptorParamName, const HTuple& DescriptorParamValue, const HTuple& MinScore, const HTuple& NumMatches, const HTuple& ScoreType, HTuple* HomMat2D, HTuple* Score)
HHomMat2DArray HDescriptorModel::FindUncalibDescriptorModel(const HImage& Image, const HTuple& DetectorParamName, const HTuple& DetectorParamValue, const HTuple& DescriptorParamName, const HTuple& DescriptorParamValue, const HTuple& MinScore, Hlong NumMatches, const HTuple& ScoreType, HTuple* Score) const
HHomMat2D HDescriptorModel::FindUncalibDescriptorModel(const HImage& Image, const HTuple& DetectorParamName, const HTuple& DetectorParamValue, const HTuple& DescriptorParamName, const HTuple& DescriptorParamValue, double MinScore, Hlong NumMatches, const HString& ScoreType, double* Score) const
HHomMat2D HDescriptorModel::FindUncalibDescriptorModel(const HImage& Image, const HTuple& DetectorParamName, const HTuple& DetectorParamValue, const HTuple& DescriptorParamName, const HTuple& DescriptorParamValue, double MinScore, Hlong NumMatches, const char* ScoreType, double* Score) const
HHomMat2D HDescriptorModel::FindUncalibDescriptorModel(const HImage& Image, const HTuple& DetectorParamName, const HTuple& DetectorParamValue, const HTuple& DescriptorParamName, const HTuple& DescriptorParamValue, double MinScore, Hlong NumMatches, const wchar_t* ScoreType, double* Score) const
(Nur Windows)
HHomMat2DArray HImage::FindUncalibDescriptorModel(const HDescriptorModel& ModelID, const HTuple& DetectorParamName, const HTuple& DetectorParamValue, const HTuple& DescriptorParamName, const HTuple& DescriptorParamValue, const HTuple& MinScore, Hlong NumMatches, const HTuple& ScoreType, HTuple* Score) const
HHomMat2D HImage::FindUncalibDescriptorModel(const HDescriptorModel& ModelID, const HTuple& DetectorParamName, const HTuple& DetectorParamValue, const HTuple& DescriptorParamName, const HTuple& DescriptorParamValue, double MinScore, Hlong NumMatches, const HString& ScoreType, double* Score) const
HHomMat2D HImage::FindUncalibDescriptorModel(const HDescriptorModel& ModelID, const HTuple& DetectorParamName, const HTuple& DetectorParamValue, const HTuple& DescriptorParamName, const HTuple& DescriptorParamValue, double MinScore, Hlong NumMatches, const char* ScoreType, double* Score) const
HHomMat2D HImage::FindUncalibDescriptorModel(const HDescriptorModel& ModelID, const HTuple& DetectorParamName, const HTuple& DetectorParamValue, const HTuple& DescriptorParamName, const HTuple& DescriptorParamValue, double MinScore, Hlong NumMatches, const wchar_t* ScoreType, double* Score) const
(Nur Windows)
static void HOperatorSet.FindUncalibDescriptorModel(HObject image, HTuple modelID, HTuple detectorParamName, HTuple detectorParamValue, HTuple descriptorParamName, HTuple descriptorParamValue, HTuple minScore, HTuple numMatches, HTuple scoreType, out HTuple homMat2D, out HTuple score)
HHomMat2D[] HDescriptorModel.FindUncalibDescriptorModel(HImage image, HTuple detectorParamName, HTuple detectorParamValue, HTuple descriptorParamName, HTuple descriptorParamValue, HTuple minScore, int numMatches, HTuple scoreType, out HTuple score)
HHomMat2D HDescriptorModel.FindUncalibDescriptorModel(HImage image, HTuple detectorParamName, HTuple detectorParamValue, HTuple descriptorParamName, HTuple descriptorParamValue, double minScore, int numMatches, string scoreType, out double score)
HHomMat2D[] HImage.FindUncalibDescriptorModel(HDescriptorModel modelID, HTuple detectorParamName, HTuple detectorParamValue, HTuple descriptorParamName, HTuple descriptorParamValue, HTuple minScore, int numMatches, HTuple scoreType, out HTuple score)
HHomMat2D HImage.FindUncalibDescriptorModel(HDescriptorModel modelID, HTuple detectorParamName, HTuple detectorParamValue, HTuple descriptorParamName, HTuple descriptorParamValue, double minScore, int numMatches, string scoreType, out double score)
Beschreibung
Der Operator find_uncalib_descriptor_modelfind_uncalib_descriptor_modelFindUncalibDescriptorModelFindUncalibDescriptorModelFindUncalibDescriptorModel
sucht den besten
Match eines Deskriptormodells ModelIDModelIDModelIDModelIDmodelID
in
einem Suchbild ImageImageImageImageimage
. Ein Deskriptormodell
beinhaltet Beschreibungen von Merkmalspunkten und muss zuvor durch
create_uncalib_descriptor_modelcreate_uncalib_descriptor_modelCreateUncalibDescriptorModelCreateUncalibDescriptorModelCreateUncalibDescriptorModel
bzw. create_calib_descriptor_modelcreate_calib_descriptor_modelCreateCalibDescriptorModelCreateCalibDescriptorModelCreateCalibDescriptorModel
erzeugt oder mit
read_descriptor_modelread_descriptor_modelReadDescriptorModelReadDescriptorModelReadDescriptorModel
eingelesen worden sein.
Ein Match wird akzeptiert, wenn er eine bessere Bewertung als
MinScoreMinScoreMinScoreMinScoreminScore
hat. Dieses Kriterium basiert auf der
'inlier_ratio' Bewertung, die weiter unten erklärt wird. Hauptergebnis
des Operators find_uncalib_descriptor_modelfind_uncalib_descriptor_modelFindUncalibDescriptorModelFindUncalibDescriptorModelFindUncalibDescriptorModel
ist die 3x3 Matrix
HomMat2DHomMat2DHomMat2DHomMat2DhomMat2D
, die eine projektive 2D Transformation von
Modellpunkten zu Suchbildpunkten darstellt. Die Matrix ist durch ihre
zeilenweise gegebenen 9 Elementen dargestellt. Tritt das gesuchte
Objekt (Template) mehrfach in ImageImageImageImageimage
auf und erfüllt es das
Kriterium MinScoreMinScoreMinScoreMinScoreminScore
, werden die resultierenden Homographien
aneinandergehängt. Die Anzahl der letztendlich gefundenen Objekte
lässt sich durch NumObjects = |HomMat2DHomMat2DHomMat2DHomMat2DhomMat2D
| / 9 berechnen.
Der Suchprozess ist in drei Phasen unterteilt. Als erstes
werden Merkmalspunkte aus dem Suchbild (aber nur innerhalb des
Definitionsbereiches des Suchbildes) extrahiert. Dies erfolgt mit dem
Punktoperator, der bei der Modellerstellung ausgewählten wurde.
Während der Modellerstellung werden auch die Parameter des
Punktoperators gesetzt. Sie können allerdings mittels
DetectorParamNameDetectorParamNameDetectorParamNameDetectorParamNamedetectorParamName
und DetectorParamValueDetectorParamValueDetectorParamValueDetectorParamValuedetectorParamValue
auch
zusätzlich angepasst werden. Hierdurch können dieser Parameter
insbesondere an Beleuchtungsschwankungen zwischen Modellerzeugung und
Suchbild angepasst werden. Es wird jedoch empfohlen, die Werte des
Modells zu verwenden (Übergabe eines leeren Tupels).
In der zweiten Phase der Suche werden Korrespondenzen zwischen
Modellpunkten und extrahierten Punkten des Suchbildes erstellt. Die
Parameter des Deskriptors werden in DescriptorParamNameDescriptorParamNameDescriptorParamNameDescriptorParamNamedescriptorParamName
und
DescriptorParamValueDescriptorParamValueDescriptorParamValueDescriptorParamValuedescriptorParamValue
gesetzt:
- 'min_score_descr'"min_score_descr""min_score_descr""min_score_descr""min_score_descr":
-
Die minimale
Klassifikatorbewertung eines Punktes, damit er als potentieller Match
betrachtet wird. Diese Bewertungsfunktion hat einen Wertebereich
von 0.0 bis 1.0. Sinnvolle Werte liegen jedoch
zwischen 0.0 und 0.1. Es ist zu beachten, dass
'min_score_descr'"min_score_descr""min_score_descr""min_score_descr""min_score_descr" u.U. eine negative Auswirkung auf die
Robustheit des Erkennungsprozesses hat. Zumindest dann, wenn wenige
Merkmalspunkte auf dem Objekt gefunden werden können.
Typische Werte sind [0.0 .. 0.1],
Defaultwert ist 0.0.
- 'guided_matching'"guided_matching""guided_matching""guided_matching""guided_matching":
Erhöht die Genauigkeit
der Objekterkennung. Das 'guided matching'"guided matching""guided matching""guided matching""guided matching" kann allerdings
in manchen Fällen auch die Rechenzeit um bis zu 10% erhöhen.
Mögliche Werte sind ['on'"on""on""on""on", 'off'"off""off""off""off"],
Defaultwert ist 'on'"on""on""on""on".
Der letzte Schritt ist die Schätzung der Homographie, die die
Punktkorrespondenzen beschreibt. Die resultierende Homographie ist
eine 2D Projektion, die eine Transformation von Modellpunkten zu
Punkten in ImageImageImageImageimage
beschreibt. Hierfür werden Natural 3D Markers
(N3Ms) verwendet, um die Punktkorrespondenz zu bestimmen (siehe Literatur).
Zusätzlich zu der geschätzten Homographie HomMat2DHomMat2DHomMat2DHomMat2DhomMat2D
liefert
der Operator eine oder mehrere ScoreScoreScoreScorescore
Bewertungen für jede
gefundene Objektinstanz, je nachdem, was der Benutzer in ScoreTypeScoreTypeScoreTypeScoreTypescoreType
eingegeben hat. Derzeit sind die folgenden Werte für ScoreTypeScoreTypeScoreTypeScoreTypescoreType
unterstützt:
- 'num_points'"num_points""num_points""num_points""num_points":
-
Anzahl der
Punktkorrespondenzen je Instanz. Wurde eine Homographie mit weniger
als 10 Korrespondenzen gefunden, so kann sie nicht als gut angenommen
werden, da im Extremfall beliebige 4 Punkte eine mathematisch
gültige Homographie beschreiben.
- 'inlier_ratio'"inlier_ratio""inlier_ratio""inlier_ratio""inlier_ratio":
Anteil von
Punktkorrespondenzen an der Anzahl der Modellpunkte.
Obwohl diese Bewertung einen Wertebereich von 0.0 bis
1.0 hat, ist es eher untypisch, dass sie einen Wert von
1.0 erreicht. Instanzen mit einem Bewertungwert
kleiner als 0.1 sollten nicht berücksichtigt werden.
Falls im Suchbild mehrere Objektinstanzen gefunden werden, werden
die resultierenden ScoreScoreScoreScorescore
Bewertungen für die
einzelnen Instanzen aneinandergehängt, sodass
|ScoreScoreScoreScorescore
| = NumObjects * |ScoreTypeScoreTypeScoreTypeScoreTypescoreType
|.
Die gefundenen Punktkorrespondenzen einzelner Instanzen können mit Hilfe
des Operators get_descriptor_model_pointsget_descriptor_model_pointsGetDescriptorModelPointsGetDescriptorModelPointsGetDescriptorModelPoints
abgefragt werden.
Achtung
Der Definitionsbereich des Suchbildes sollte das gesamte gesuchte
Objekt enthalten, da die Merkmalspunkte nur innerhalb des
Definitionsbereiches des Suchbildes extrahiert werden. Das bedeutet,
dass der resultierende ScoreScoreScoreScorescore
entsprechend kleiner wird, wenn
der Definitionsbereich nicht das gesamte gesuchte Objekt enthält.
Des Weiteren ist zu beachten, dass Matches auch dann zurück gegeben
werden, wenn der Referenzpunkt des Modells außerhalb des
Definitionsbereiches des Suchbildes liegt. Die beiden hier
geschilderten Auswirkungen des Definitionsbereiches des Suchbildes
unterscheiden sich grundsätzlich von der Auswirkung des
Definitionsbereiches beim formbasierten Matching, wo der
Definitionsbereich den Suchraum für den Referenzpunkt des Modells
darstellt.
Ausführungsinformationen
- Multithreading-Typ: reentrant (läuft parallel zu nicht-exklusiven Operatoren).
- Multithreading-Bereich: global (kann von jedem Thread aufgerufen werden).
- Wird ohne Parallelisierung verarbeitet.
Parameter
ImageImageImageImageimage
(input_object) singlechannelimage →
objectHImageHImageHobject (byte / uint2)
Das Suchbild.
ModelIDModelIDModelIDModelIDmodelID
(input_control) descriptor_model →
HDescriptorModel, HTupleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)
Der Handle des Deskriptormodells.
DetectorParamNameDetectorParamNameDetectorParamNameDetectorParamNamedetectorParamName
(input_control) attribute.name-array →
HTupleHTupleHtuple (string) (string) (HString) (char*)
Namen der Parameter des Detektors.
Defaultwert: []
Werteliste: 'alpha'"alpha""alpha""alpha""alpha", 'check_neighbor'"check_neighbor""check_neighbor""check_neighbor""check_neighbor", 'mask_size_grd'"mask_size_grd""mask_size_grd""mask_size_grd""mask_size_grd", 'mask_size_smooth'"mask_size_smooth""mask_size_smooth""mask_size_smooth""mask_size_smooth", 'min_check_neighbor_diff'"min_check_neighbor_diff""min_check_neighbor_diff""min_check_neighbor_diff""min_check_neighbor_diff", 'min_score'"min_score""min_score""min_score""min_score", 'radius'"radius""radius""radius""radius", 'sigma_grad'"sigma_grad""sigma_grad""sigma_grad""sigma_grad", 'sigma_smooth'"sigma_smooth""sigma_smooth""sigma_smooth""sigma_smooth", 'subpix'"subpix""subpix""subpix""subpix", 'threshold'"threshold""threshold""threshold""threshold"
DetectorParamValueDetectorParamValueDetectorParamValueDetectorParamValuedetectorParamValue
(input_control) attribute.value-array →
HTupleHTupleHtuple (integer / real / string) (int / long / double / string) (Hlong / double / HString) (Hlong / double / char*)
Werte der Detektor-Parameter.
Defaultwert: []
Wertevorschläge: 0.08, 1, 1.2, 3, 15, 30, 1000, 'on'"on""on""on""on", 'off'"off""off""off""off"
DescriptorParamNameDescriptorParamNameDescriptorParamNameDescriptorParamNamedescriptorParamName
(input_control) attribute.name-array →
HTupleHTupleHtuple (string) (string) (HString) (char*)
Namen der Deskriptor-Parameter.
Defaultwert: []
Werteliste: 'guided_matching'"guided_matching""guided_matching""guided_matching""guided_matching", 'min_score_descr'"min_score_descr""min_score_descr""min_score_descr""min_score_descr"
DescriptorParamValueDescriptorParamValueDescriptorParamValueDescriptorParamValuedescriptorParamValue
(input_control) attribute.value-array →
HTupleHTupleHtuple (real / integer / string) (double / int / long / string) (double / Hlong / HString) (double / Hlong / char*)
Werte der Deskriptor-Parameter.
Defaultwert: []
Wertevorschläge: 0.0, 0.001, 0.005, 0.01, 'on'"on""on""on""on", 'off'"off""off""off""off"
MinScoreMinScoreMinScoreMinScoreminScore
(input_control) real(-array) →
HTupleHTupleHtuple (real) (double) (double) (double)
Minimale Bewertung der zu findenden Instanzen
der Modelle.
Defaultwert: 0.2
Wertevorschläge: 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0
Typischer Wertebereich: 0
≤
MinScore
MinScore
MinScore
MinScore
minScore
≤
1
NumMatchesNumMatchesNumMatchesNumMatchesnumMatches
(input_control) integer →
HTupleHTupleHtuple (integer) (int / long) (Hlong) (Hlong)
Maximale Anzahl von gefundenen Instanzen.
Defaultwert: 1
Wertevorschläge: 1, 2, 3, 4
Restriktion: NumMatches >= 1
ScoreTypeScoreTypeScoreTypeScoreTypescoreType
(input_control) string(-array) →
HTupleHTupleHtuple (string) (string) (HString) (char*)
Bewertungtyp berechnet in ScoreScoreScoreScorescore
.
Defaultwert:
'num_points'
"num_points"
"num_points"
"num_points"
"num_points"
Werteliste: 'inlier_ratio'"inlier_ratio""inlier_ratio""inlier_ratio""inlier_ratio", 'num_points'"num_points""num_points""num_points""num_points"
HomMat2DHomMat2DHomMat2DHomMat2DhomMat2D
(output_control) hom_mat2d(-array) →
HHomMat2D, HTupleHTupleHtuple (real) (double) (double) (double)
Homographie zwischen Modell und gefundenem Objekt.
ScoreScoreScoreScorescore
(output_control) number(-array) →
HTupleHTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)
Bewertung der gefundenen Instanzen gemäß
ausgewählten ScoreType.
Beispiel (HDevelop)
create_uncalib_descriptor_model (ImageReduced,'harris',[],[], \
[],[],42,ModelID)
get_descriptor_model_params (ModelID,DetectorType, \
DetectorParamName,DetectorParamValue, \
DescriptorParamName,DescriptorParamValue)
write_descriptor_model (ModelID,'simple_example.dsm')
read_descriptor_model ('simple_example.dsm',ModelID)
find_uncalib_descriptor_model (SearchImage,ModelID,[],[],[],[],0.2,1, \
['num_points','inlier_ratio'],HomMat2D,Score)
Vorgänger
create_uncalib_descriptor_modelcreate_uncalib_descriptor_modelCreateUncalibDescriptorModelCreateUncalibDescriptorModelCreateUncalibDescriptorModel
,
create_calib_descriptor_modelcreate_calib_descriptor_modelCreateCalibDescriptorModelCreateCalibDescriptorModelCreateCalibDescriptorModel
,
read_descriptor_modelread_descriptor_modelReadDescriptorModelReadDescriptorModelReadDescriptorModel
Siehe auch
create_uncalib_descriptor_modelcreate_uncalib_descriptor_modelCreateUncalibDescriptorModelCreateUncalibDescriptorModelCreateUncalibDescriptorModel
,
create_calib_descriptor_modelcreate_calib_descriptor_modelCreateCalibDescriptorModelCreateCalibDescriptorModelCreateCalibDescriptorModel
,
find_calib_descriptor_modelfind_calib_descriptor_modelFindCalibDescriptorModelFindCalibDescriptorModelFindCalibDescriptorModel
,
get_descriptor_model_pointsget_descriptor_model_pointsGetDescriptorModelPointsGetDescriptorModelPointsGetDescriptorModelPoints
Literatur
S. Hinterstoisser, S. Benhimane, and N. Navab: „N3M: Natural 3D Markers for
Real-Time Object Detection and Pose Estimation.„
IEEE 11th International Conference on Computer Vision, 2007. pp. 1-7,
ICCV 2007.
Modul
Matching