find_uncalib_descriptor_modelT_find_uncalib_descriptor_modelFindUncalibDescriptorModelFindUncalibDescriptorModelfind_uncalib_descriptor_model (Operator)

Name

find_uncalib_descriptor_modelT_find_uncalib_descriptor_modelFindUncalibDescriptorModelFindUncalibDescriptorModelfind_uncalib_descriptor_model — Suchen die besten Matches eines Deskriptormodells in einem Suchbild.

Signatur

find_uncalib_descriptor_model(Image : : ModelID, DetectorParamName, DetectorParamValue, DescriptorParamName, DescriptorParamValue, MinScore, NumMatches, ScoreType : HomMat2D, Score)

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)

def find_uncalib_descriptor_model(image: HObject, model_id: HHandle, detector_param_name: Sequence[str], detector_param_value: Sequence[Union[int, float, str]], descriptor_param_name: Sequence[str], descriptor_param_value: Sequence[Union[int, float, str]], min_score: MaybeSequence[float], num_matches: int, score_type: MaybeSequence[str]) -> Tuple[Sequence[float], Sequence[Union[float, int]]]

def find_uncalib_descriptor_model_s(image: HObject, model_id: HHandle, detector_param_name: Sequence[str], detector_param_value: Sequence[Union[int, float, str]], descriptor_param_name: Sequence[str], descriptor_param_value: Sequence[Union[int, float, str]], min_score: MaybeSequence[float], num_matches: int, score_type: MaybeSequence[str]) -> Tuple[Sequence[float], Union[float, int]]

Beschreibung

Der Operator find_uncalib_descriptor_modelfind_uncalib_descriptor_modelFindUncalibDescriptorModelFindUncalibDescriptorModelFindUncalibDescriptorModelfind_uncalib_descriptor_model sucht den besten Match eines Deskriptormodells ModelIDModelIDModelIDModelIDmodelIDmodel_id in einem Suchbild ImageImageImageImageimageimage. Ein Deskriptormodell beinhaltet Beschreibungen von Merkmalspunkten und muss zuvor durch create_uncalib_descriptor_modelcreate_uncalib_descriptor_modelCreateUncalibDescriptorModelCreateUncalibDescriptorModelCreateUncalibDescriptorModelcreate_uncalib_descriptor_model bzw. create_calib_descriptor_modelcreate_calib_descriptor_modelCreateCalibDescriptorModelCreateCalibDescriptorModelCreateCalibDescriptorModelcreate_calib_descriptor_model erzeugt oder mit read_descriptor_modelread_descriptor_modelReadDescriptorModelReadDescriptorModelReadDescriptorModelread_descriptor_model eingelesen worden sein.

Ein Match wird akzeptiert, wenn er eine bessere Bewertung als MinScoreMinScoreMinScoreMinScoreminScoremin_score hat. Dieses Kriterium basiert auf der 'inlier_ratio' Bewertung, die weiter unten erklärt wird. Hauptergebnis des Operators find_uncalib_descriptor_modelfind_uncalib_descriptor_modelFindUncalibDescriptorModelFindUncalibDescriptorModelFindUncalibDescriptorModelfind_uncalib_descriptor_model ist die 3x3 Matrix HomMat2DHomMat2DHomMat2DHomMat2DhomMat2Dhom_mat_2d, 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 ImageImageImageImageimageimage auf und erfüllt es das Kriterium MinScoreMinScoreMinScoreMinScoreminScoremin_score, werden die resultierenden Homographien aneinandergehängt. Die Anzahl der letztendlich gefundenen Objekte lässt sich durch NumObjects = |HomMat2DHomMat2DHomMat2DHomMat2DhomMat2Dhom_mat_2d| / 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 DetectorParamNameDetectorParamNameDetectorParamNameDetectorParamNamedetectorParamNamedetector_param_name und DetectorParamValueDetectorParamValueDetectorParamValueDetectorParamValuedetectorParamValuedetector_param_value 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 DescriptorParamNameDescriptorParamNameDescriptorParamNameDescriptorParamNamedescriptorParamNamedescriptor_param_name und DescriptorParamValueDescriptorParamValueDescriptorParamValueDescriptorParamValuedescriptorParamValuedescriptor_param_value gesetzt:

'min_score_descr'"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""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""guided_matching":

Erhöht die Genauigkeit der Objekterkennung. Das 'guided_matching'"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""on", 'off'"off""off""off""off""off"], Defaultwert ist 'on'"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 ImageImageImageImageimageimage beschreibt. Hierfür werden Natural 3D Markers (N3Ms) verwendet, um die Punktkorrespondenz zu bestimmen (siehe Literatur).

Zusätzlich zu der geschätzten Homographie HomMat2DHomMat2DHomMat2DHomMat2DhomMat2Dhom_mat_2d liefert der Operator eine oder mehrere ScoreScoreScoreScorescorescore Bewertungen für jede gefundene Objektinstanz, je nachdem, was der Benutzer in ScoreTypeScoreTypeScoreTypeScoreTypescoreTypescore_type eingegeben hat. Derzeit sind die folgenden Werte für ScoreTypeScoreTypeScoreTypeScoreTypescoreTypescore_type unterstützt:

'num_points'"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""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 ScoreScoreScoreScorescorescore Bewertungen für die einzelnen Instanzen aneinandergehängt, sodass |ScoreScoreScoreScorescorescore| = NumObjects * |ScoreTypeScoreTypeScoreTypeScoreTypescoreTypescore_type|.

Die gefundenen Punktkorrespondenzen einzelner Instanzen können mit Hilfe des Operators get_descriptor_model_pointsget_descriptor_model_pointsGetDescriptorModelPointsGetDescriptorModelPointsGetDescriptorModelPointsget_descriptor_model_points 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 ScoreScoreScoreScorescorescore 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

Parameter

ImageImageImageImageimageimage (input_object)  singlechannelimage objectHImageHObjectHImageHobject (byte / uint2)

Das Suchbild.

ModelIDModelIDModelIDModelIDmodelIDmodel_id (input_control)  descriptor_model HDescriptorModel, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

Der Handle des Deskriptormodells.

DetectorParamNameDetectorParamNameDetectorParamNameDetectorParamNamedetectorParamNamedetector_param_name (input_control)  attribute.name-array HTupleSequence[str]HTupleHtuple (string) (string) (HString) (char*)

Namen der Parameter des Detektors.

Defaultwert: []

Werteliste: 'alpha'"alpha""alpha""alpha""alpha""alpha", 'check_neighbor'"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_grd", 'mask_size_smooth'"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_check_neighbor_diff", 'min_score'"min_score""min_score""min_score""min_score""min_score", 'radius'"radius""radius""radius""radius""radius", 'sigma_grad'"sigma_grad""sigma_grad""sigma_grad""sigma_grad""sigma_grad", 'sigma_smooth'"sigma_smooth""sigma_smooth""sigma_smooth""sigma_smooth""sigma_smooth", 'subpix'"subpix""subpix""subpix""subpix""subpix", 'threshold'"threshold""threshold""threshold""threshold""threshold"

DetectorParamValueDetectorParamValueDetectorParamValueDetectorParamValuedetectorParamValuedetector_param_value (input_control)  attribute.value-array HTupleSequence[Union[int, float, str]]HTupleHtuple (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""on", 'off'"off""off""off""off""off"

DescriptorParamNameDescriptorParamNameDescriptorParamNameDescriptorParamNamedescriptorParamNamedescriptor_param_name (input_control)  attribute.name-array HTupleSequence[str]HTupleHtuple (string) (string) (HString) (char*)

Namen der Deskriptor-Parameter.

Defaultwert: []

Werteliste: 'guided_matching'"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""min_score_descr"

DescriptorParamValueDescriptorParamValueDescriptorParamValueDescriptorParamValuedescriptorParamValuedescriptor_param_value (input_control)  attribute.value-array HTupleSequence[Union[int, float, str]]HTupleHtuple (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""on", 'off'"off""off""off""off""off"

MinScoreMinScoreMinScoreMinScoreminScoremin_score (input_control)  real(-array) HTupleMaybeSequence[float]HTupleHtuple (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 min_score ≤ 1

NumMatchesNumMatchesNumMatchesNumMatchesnumMatchesnum_matches (input_control)  integer HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Maximale Anzahl von gefundenen Instanzen.

Defaultwert: 1

Wertevorschläge: 1, 2, 3, 4

Restriktion: NumMatches >= 1

ScoreTypeScoreTypeScoreTypeScoreTypescoreTypescore_type (input_control)  string(-array) HTupleMaybeSequence[str]HTupleHtuple (string) (string) (HString) (char*)

Bewertungstyp berechnet in ScoreScoreScoreScorescorescore.

Defaultwert: 'num_points' "num_points" "num_points" "num_points" "num_points" "num_points"

Werteliste: 'inlier_ratio'"inlier_ratio""inlier_ratio""inlier_ratio""inlier_ratio""inlier_ratio", 'num_points'"num_points""num_points""num_points""num_points""num_points"

HomMat2DHomMat2DHomMat2DHomMat2DhomMat2Dhom_mat_2d (output_control)  hom_mat2d(-array) HHomMat2D, HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)

Homographie zwischen Modell und gefundenem Objekt.

ScoreScoreScoreScorescorescore (output_control)  number(-array) HTupleSequence[Union[float, int]]HTupleHtuple (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_modelCreateUncalibDescriptorModelCreateUncalibDescriptorModelCreateUncalibDescriptorModelcreate_uncalib_descriptor_model, create_calib_descriptor_modelcreate_calib_descriptor_modelCreateCalibDescriptorModelCreateCalibDescriptorModelCreateCalibDescriptorModelcreate_calib_descriptor_model, read_descriptor_modelread_descriptor_modelReadDescriptorModelReadDescriptorModelReadDescriptorModelread_descriptor_model

Siehe auch

create_uncalib_descriptor_modelcreate_uncalib_descriptor_modelCreateUncalibDescriptorModelCreateUncalibDescriptorModelCreateUncalibDescriptorModelcreate_uncalib_descriptor_model, create_calib_descriptor_modelcreate_calib_descriptor_modelCreateCalibDescriptorModelCreateCalibDescriptorModelCreateCalibDescriptorModelcreate_calib_descriptor_model, find_calib_descriptor_modelfind_calib_descriptor_modelFindCalibDescriptorModelFindCalibDescriptorModelFindCalibDescriptorModelfind_calib_descriptor_model, get_descriptor_model_pointsget_descriptor_model_pointsGetDescriptorModelPointsGetDescriptorModelPointsGetDescriptorModelPointsget_descriptor_model_points

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