Skip to content

find_uncalib_descriptor_modelfind_uncalib_descriptor_modelFindUncalibDescriptorModelFindUncalibDescriptorModelfind_uncalib_descriptor_modelT_find_uncalib_descriptor_model🔗

Short description🔗

find_uncalib_descriptor_modelfind_uncalib_descriptor_modelFindUncalibDescriptorModelFindUncalibDescriptorModelfind_uncalib_descriptor_modelT_find_uncalib_descriptor_model — Find the best matches of a descriptor model in an image.

Signature🔗

find_uncalib_descriptor_model( image Image, descriptor_model ModelID, attribute.name DetectorParamName, attribute.value DetectorParamValue, attribute.name DescriptorParamName, attribute.value DescriptorParamValue, real MinScore, integer NumMatches, string ScoreType, out hom_mat2d HomMat2D, out number Score )find_uncalib_descriptor_model( Image : : ModelID, DetectorParamName, DetectorParamValue, DescriptorParamName, DescriptorParamValue, MinScore, NumMatches, ScoreType : HomMat2D, 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 )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 )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]]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 )

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 (Windows only)

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 (Windows only)

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 )

Description🔗

The operator find_uncalib_descriptor_modelFindUncalibDescriptorModel finds the best matches of a descriptor model ModelIDmodelIDmodel_id in Imageimageimage. The descriptor model must have been created previously by calling create_uncalib_descriptor_modelCreateUncalibDescriptorModel, create_calib_descriptor_modelCreateCalibDescriptorModel or read_descriptor_modelReadDescriptorModel.

A match is only accepted if its score exceeds the value of MinScoreminScoremin_score. This criterion is based on the ‘inlier_ratio’ score that is described in details below. The main result of the operator find_uncalib_descriptor_modelFindUncalibDescriptorModel for each match is a 3x3 matrix HomMat2DhomMat2Dhom_mat_2d, which describes a 2D projection of model points to search image points and is represented by a tuple of 9 elements in row-major order. If more matches of the searched object (template) appear and pass the MinScoreminScoremin_score criterion, the resulting multiple homographies are concatenated. The number of objects actually found is then equal to NumObjects = |HomMat2DhomMat2Dhom_mat_2d|/9.

The detection process is divided into three parts. First, interest points are extracted from the search image (only inside the domain of the search image). This is done using the point detector and its parameters selected once during the generation of the model. However, DetectorParamNamedetectorParamNamedetector_param_name and DetectorParamValuedetectorParamValuedetector_param_value can be used to specify different detector parameter values during the find_uncalib_descriptor_modelFindUncalibDescriptorModel call. By changing these parameters, it is possible to adjust to illumination changes between the model generation and the online detection. However, it is recommended to use the same values used to create the model (pass an empty tuple).

The second step of the detection process is to calculate correspondences between the model points and the points that were detected. The run time parameters of the descriptor can be adjusted with DescriptorParamNamedescriptorParamNamedescriptor_param_name and DescriptorParamValuedescriptorParamValuedescriptor_param_value:

  • 'min_score_descr'"min_score_descr": is the minimal classifier score for an interest point to be regarded as a potential match. The score function is between 0.0 and 1.0, but typically only values between 0.0 and 0.1 make sense. Increasing 'min_score_descr'"min_score_descr" can increase significantly the detection speed. Note, however, that using 'min_score_descr'"min_score_descr" might have negative effect on the robustness of the detection process, especially when only few points can be found. Typical values are [0.00.0 .. 0.10.1], default value is 0.00.0.

  • 'guided_matching'"guided_matching": enhances the accuracy of the object recognition when switched on. Note that it increases the computational costs up to 10% in some cases. Possible values are ['on'"on", 'off'"off"], default value is 'on'"on".

The last step is the estimation of a homography that describes the point correspondences. The homography is a 2D projection, which describes a transformation from model points to points in Imageimageimage. Here, Natural 3D Markers (N3Ms) are utilized to identify robustly the point correspondences (see references).

Additionally to the estimated homography in HomMat2DhomMat2Dhom_mat_2d, the operator returns one or more Scorescorescore estimations per object instance as specified by the user in a tuple ScoreTypescoreTypescore_type. Currently the following values for ScoreTypescoreTypescore_type are supported:

  • 'num_points'"num_points": number of point correspondences per instance. An object instance should be considered good, if it has 10 or more point correspondences with the model. Fewer points are insufficient, because any random 4 point correspondences define a mathematically correct homography between two images.

  • 'inlier_ratio'"inlier_ratio": the ratio of the number of point correspondences to the number of model points. Although this value can have values of [0.00.0 .. 1.01.0], it is rather unlikely that this ratio can reach 1.01.0. Yet, objects having inlier ratio less than 0.10.1, should be disregarded.

Note that the resulting scores for more than one object instance will be concatenated in Scorescorescore, such that |Scorescorescore| = NumObjects*|ScoreTypescoreTypescore_type|.

The point correspondences for each object can be queried with get_descriptor_model_pointsGetDescriptorModelPoints.

Attention🔗

Note that the domain of the search image should contain the whole object to be searched for because interest points are only extracted inside the domain of the search image. This means that if the domain does not contain the full object to be searched for, the resulting Scorescorescore will decrease. Note also that matches may be found even if the reference point (origin) of the model lies outside of the domain of the search image. Both is in contrast to shape-based matching, where the domain of the search image defines the search space for the reference point of the model.

Execution information🔗

Execution information
  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).

  • Multithreading scope: global (may be called from any thread).

  • Processed without parallelization.

Parameters🔗

Imageimageimage (input_object) singlechannelimage → object (byte / uint2)object (byte / uint2)HObject (byte / uint2)HImage (byte / uint2)HObject (byte / uint2)Hobject (byte / uint2)

Input image where the model should be found.

ModelIDmodelIDmodel_id (input_control) descriptor_model → (handle)(handle)HTuple (HHandle)HDescriptorModel, HTuple (IntPtr)HHandleHtuple (handle)

The handle to the descriptor model.

DetectorParamNamedetectorParamNamedetector_param_name (input_control) attribute.name-array → (string)(string)HTuple (HString)HTuple (string)Sequence[str]Htuple (char*)

The detector’s parameter names.

Default: [][]
List of values: 'alpha', 'check_neighbor', 'mask_size_grd', 'mask_size_smooth', 'min_check_neighbor_diff', 'min_score', 'radius', 'sigma_grad', 'sigma_smooth', 'subpix', 'threshold'"alpha", "check_neighbor", "mask_size_grd", "mask_size_smooth", "min_check_neighbor_diff", "min_score", "radius", "sigma_grad", "sigma_smooth", "subpix", "threshold"

DetectorParamValuedetectorParamValuedetector_param_value (input_control) attribute.value-array → (integer / real / string)(integer / real / string)HTuple (Hlong / double / HString)HTuple (int / long / double / string)Sequence[Union[int, float, str]]Htuple (Hlong / double / char*)

Values of the detector’s parameters.

Default: [][]
Suggested values: 0.08, 1, 1.2, 3, 15, 30, 1000, 'on', 'off'0.08, 1, 1.2, 3, 15, 30, 1000, "on", "off"

DescriptorParamNamedescriptorParamNamedescriptor_param_name (input_control) attribute.name-array → (string)(string)HTuple (HString)HTuple (string)Sequence[str]Htuple (char*)

The descriptor’s parameter names.

Default: [][]
List of values: 'guided_matching', 'min_score_descr'"guided_matching", "min_score_descr"

DescriptorParamValuedescriptorParamValuedescriptor_param_value (input_control) attribute.value-array → (real / integer / string)(real / integer / string)HTuple (double / Hlong / HString)HTuple (double / int / long / string)Sequence[Union[int, float, str]]Htuple (double / Hlong / char*)

Values of the descriptor’s parameters.

Default: [][]
Suggested values: 0.0, 0.001, 0.005, 0.01, 'on', 'off'0.0, 0.001, 0.005, 0.01, "on", "off"

MinScoreminScoremin_score (input_control) real(-array) → (real)(real)HTuple (double)HTuple (double)MaybeSequence[float]Htuple (double)

Minimum score of the instances of the models to be found.

Default: 0.20.2
Suggested values: 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.00.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0
Value range: 0 ≤ MinScore ≤ 1

NumMatchesnumMatchesnum_matches (input_control) integer → (integer)(integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

Maximal number of found instances.

Default: 11
Suggested values: 1, 2, 3, 41, 2, 3, 4
Restriction: NumMatches >= 1

ScoreTypescoreTypescore_type (input_control) string(-array) → (string)(string)HTuple (HString)HTuple (string)MaybeSequence[str]Htuple (char*)

Score type to be evaluated in Scorescorescore.

Default: 'num_points'"num_points"
List of values: 'inlier_ratio', 'num_points'"inlier_ratio", "num_points"

HomMat2DhomMat2Dhom_mat_2d (output_control) hom_mat2d(-array) → (real)(real)HTuple (double)HHomMat2D, HTuple (double)Sequence[float]Htuple (double)

Homography between model and found instance.

Scorescorescore (output_control) number(-array) → (real / integer)(real / integer)HTuple (double / Hlong)HTuple (double / int / long)Sequence[Union[float, int]]Htuple (double / Hlong)

Score of the found instances according to the ScoreType input.

Example🔗

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

Combinations with other operators🔗

Combinations

Possible predecessors

create_uncalib_descriptor_modelCreateUncalibDescriptorModel, create_calib_descriptor_modelCreateCalibDescriptorModel, read_descriptor_modelReadDescriptorModel

See also

create_uncalib_descriptor_modelCreateUncalibDescriptorModel, create_calib_descriptor_modelCreateCalibDescriptorModel, find_calib_descriptor_modelFindCalibDescriptorModel, get_descriptor_model_pointsGetDescriptorModelPoints

References🔗

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.

Module🔗

Matching