Skip to content

find_calib_descriptor_modelfind_calib_descriptor_modelFindCalibDescriptorModelFindCalibDescriptorModelfind_calib_descriptor_modelT_find_calib_descriptor_model๐Ÿ”—

Short description๐Ÿ”—

find_calib_descriptor_modelfind_calib_descriptor_modelFindCalibDescriptorModelFindCalibDescriptorModelfind_calib_descriptor_modelT_find_calib_descriptor_model โ€” Find the best matches of a calibrated descriptor model in an image and return their 3D pose.

Signature๐Ÿ”—

find_calib_descriptor_model( image Image, descriptor_model ModelID, attribute.name DetectorParamName, attribute.value DetectorParamValue, attribute.name DescriptorParamName, attribute.value DescriptorParamValue, real MinScore, integer NumMatches, campar CamParam, string ScoreType, out pose Pose, out number Score )find_calib_descriptor_model( Image : : ModelID, DetectorParamName, DetectorParamValue, DescriptorParamName, DescriptorParamValue, MinScore, NumMatches, CamParam, ScoreType : Pose, Score )void FindCalibDescriptorModel( 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& CamParam, const HTuple& ScoreType, HTuple* Pose, HTuple* Score )static void HOperatorSet.FindCalibDescriptorModel( HObject image, HTuple modelID, HTuple detectorParamName, HTuple detectorParamValue, HTuple descriptorParamName, HTuple descriptorParamValue, HTuple minScore, HTuple numMatches, HTuple camParam, HTuple scoreType, out HTuple pose, out HTuple score )def find_calib_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, cam_param: Sequence[Union[float, int, str]], score_type: MaybeSequence[str] ) -> Tuple[Sequence[Union[float, int]], Sequence[Union[float, int]]]

def find_calib_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, cam_param: Sequence[Union[float, int, str]], score_type: MaybeSequence[str] ) -> Tuple[Sequence[Union[float, int]], Union[float, int]]Herror T_find_calib_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 CamParam, const Htuple ScoreType, Htuple* Pose, Htuple* Score )

HPoseArray HDescriptorModel::FindCalibDescriptorModel( const HImage& Image, const HTuple& DetectorParamName, const HTuple& DetectorParamValue, const HTuple& DescriptorParamName, const HTuple& DescriptorParamValue, const HTuple& MinScore, Hlong NumMatches, const HCamPar& CamParam, const HTuple& ScoreType, HTuple* Score ) const

HPose HDescriptorModel::FindCalibDescriptorModel( const HImage& Image, const HTuple& DetectorParamName, const HTuple& DetectorParamValue, const HTuple& DescriptorParamName, const HTuple& DescriptorParamValue, double MinScore, Hlong NumMatches, const HCamPar& CamParam, const HString& ScoreType, double* Score ) const

HPose HDescriptorModel::FindCalibDescriptorModel( const HImage& Image, const HTuple& DetectorParamName, const HTuple& DetectorParamValue, const HTuple& DescriptorParamName, const HTuple& DescriptorParamValue, double MinScore, Hlong NumMatches, const HCamPar& CamParam, const char* ScoreType, double* Score ) const

HPose HDescriptorModel::FindCalibDescriptorModel( const HImage& Image, const HTuple& DetectorParamName, const HTuple& DetectorParamValue, const HTuple& DescriptorParamName, const HTuple& DescriptorParamValue, double MinScore, Hlong NumMatches, const HCamPar& CamParam, const wchar_t* ScoreType, double* Score ) const (Windows only)

HPoseArray HImage::FindCalibDescriptorModel( const HDescriptorModel& ModelID, const HTuple& DetectorParamName, const HTuple& DetectorParamValue, const HTuple& DescriptorParamName, const HTuple& DescriptorParamValue, const HTuple& MinScore, Hlong NumMatches, const HCamPar& CamParam, const HTuple& ScoreType, HTuple* Score ) const

HPose HImage::FindCalibDescriptorModel( const HDescriptorModel& ModelID, const HTuple& DetectorParamName, const HTuple& DetectorParamValue, const HTuple& DescriptorParamName, const HTuple& DescriptorParamValue, double MinScore, Hlong NumMatches, const HCamPar& CamParam, const HString& ScoreType, double* Score ) const

HPose HImage::FindCalibDescriptorModel( const HDescriptorModel& ModelID, const HTuple& DetectorParamName, const HTuple& DetectorParamValue, const HTuple& DescriptorParamName, const HTuple& DescriptorParamValue, double MinScore, Hlong NumMatches, const HCamPar& CamParam, const char* ScoreType, double* Score ) const

HPose HImage::FindCalibDescriptorModel( const HDescriptorModel& ModelID, const HTuple& DetectorParamName, const HTuple& DetectorParamValue, const HTuple& DescriptorParamName, const HTuple& DescriptorParamValue, double MinScore, Hlong NumMatches, const HCamPar& CamParam, const wchar_t* ScoreType, double* Score ) const (Windows only)

HPoseArray HCamPar::FindCalibDescriptorModel( const HImage& Image, 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

HPose HCamPar::FindCalibDescriptorModel( const HImage& Image, 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

HPose HCamPar::FindCalibDescriptorModel( const HImage& Image, 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

HPose HCamPar::FindCalibDescriptorModel( const HImage& Image, 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)

static HTuple HPose::FindCalibDescriptorModel( const HImage& Image, const HDescriptorModel& ModelID, const HTuple& DetectorParamName, const HTuple& DetectorParamValue, const HTuple& DescriptorParamName, const HTuple& DescriptorParamValue, const HTuple& MinScore, Hlong NumMatches, const HCamPar& CamParam, const HTuple& ScoreType, HPoseArray* Pose )

double HPose::FindCalibDescriptorModel( const HImage& Image, const HDescriptorModel& ModelID, const HTuple& DetectorParamName, const HTuple& DetectorParamValue, const HTuple& DescriptorParamName, const HTuple& DescriptorParamValue, double MinScore, Hlong NumMatches, const HCamPar& CamParam, const HString& ScoreType )

double HPose::FindCalibDescriptorModel( const HImage& Image, const HDescriptorModel& ModelID, const HTuple& DetectorParamName, const HTuple& DetectorParamValue, const HTuple& DescriptorParamName, const HTuple& DescriptorParamValue, double MinScore, Hlong NumMatches, const HCamPar& CamParam, const char* ScoreType )

double HPose::FindCalibDescriptorModel( const HImage& Image, const HDescriptorModel& ModelID, const HTuple& DetectorParamName, const HTuple& DetectorParamValue, const HTuple& DescriptorParamName, const HTuple& DescriptorParamValue, double MinScore, Hlong NumMatches, const HCamPar& CamParam, const wchar_t* ScoreType ) (Windows only)

HPose[] HDescriptorModel.FindCalibDescriptorModel( HImage image, HTuple detectorParamName, HTuple detectorParamValue, HTuple descriptorParamName, HTuple descriptorParamValue, HTuple minScore, int numMatches, HCamPar camParam, HTuple scoreType, out HTuple score )

HPose HDescriptorModel.FindCalibDescriptorModel( HImage image, HTuple detectorParamName, HTuple detectorParamValue, HTuple descriptorParamName, HTuple descriptorParamValue, double minScore, int numMatches, HCamPar camParam, string scoreType, out double score )

HPose[] HImage.FindCalibDescriptorModel( HDescriptorModel modelID, HTuple detectorParamName, HTuple detectorParamValue, HTuple descriptorParamName, HTuple descriptorParamValue, HTuple minScore, int numMatches, HCamPar camParam, HTuple scoreType, out HTuple score )

HPose HImage.FindCalibDescriptorModel( HDescriptorModel modelID, HTuple detectorParamName, HTuple detectorParamValue, HTuple descriptorParamName, HTuple descriptorParamValue, double minScore, int numMatches, HCamPar camParam, string scoreType, out double score )

HPose[] HCamPar.FindCalibDescriptorModel( HImage image, HDescriptorModel modelID, HTuple detectorParamName, HTuple detectorParamValue, HTuple descriptorParamName, HTuple descriptorParamValue, HTuple minScore, int numMatches, HTuple scoreType, out HTuple score )

HPose HCamPar.FindCalibDescriptorModel( HImage image, HDescriptorModel modelID, HTuple detectorParamName, HTuple detectorParamValue, HTuple descriptorParamName, HTuple descriptorParamValue, double minScore, int numMatches, string scoreType, out double score )

static HTuple HPose.FindCalibDescriptorModel( HImage image, HDescriptorModel modelID, HTuple detectorParamName, HTuple detectorParamValue, HTuple descriptorParamName, HTuple descriptorParamValue, HTuple minScore, int numMatches, HCamPar camParam, HTuple scoreType, out HPose[] pose )

double HPose.FindCalibDescriptorModel( HImage image, HDescriptorModel modelID, HTuple detectorParamName, HTuple detectorParamValue, HTuple descriptorParamName, HTuple descriptorParamValue, double minScore, int numMatches, HCamPar camParam, string scoreType )

Description๐Ÿ”—

The operator find_calib_descriptor_modelFindCalibDescriptorModel finds the best NumMatchesnumMatchesnum_matches matches of the descriptor model ModelIDmodelIDmodel_id in Imageimageimage. The descriptor model must have been created previously by calling create_calib_descriptor_modelCreateCalibDescriptorModel or read_descriptor_modelReadDescriptorModel.

The operator returns the 3D Poseposepose (in camera coordinate system) of the template object found in the search Imageimageimage. As two different cameras can be used for the model generation and the online search, the camera parameters of the camera used to create Imageimageimage have to be set in CamParamcamParamcam_param. Therefore, there is no need to correct any distortions in Imageimageimage manually.

The detection process is the same as for find_uncalib_descriptor_modelFindUncalibDescriptorModel. The setting of DetectorParamNamedetectorParamNamedetector_param_name, DetectorParamValuedetectorParamValuedetector_param_value, DescriptorParamNamedescriptorParamNamedescriptor_param_name, DescriptorParamValuedescriptorParamValuedescriptor_param_value, MinScoreminScoremin_score, NumMatchesnumMatchesnum_matches and ScoreTypescoreTypescore_type are explained with find_uncalib_descriptor_modelFindUncalibDescriptorModel. After the object was detected, and using the world (from reference plane) coordinates of the matched model points (explained with create_calib_descriptor_modelCreateCalibDescriptorModel), the pose of the object is computed similarly to applying vector_to_poseVectorToPose operator.

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

CamParamcamParamcam_param (input_control) campar โ†’ (real / integer / string)(real / integer / string)HTuple (double / Hlong / HString)HCamPar, HTuple (double / int / long / string)Sequence[Union[float, int, str]]Htuple (double / Hlong / char*)

Camera parameter (inner orientation) obtained from camera calibration.

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"

Poseposepose (output_control) pose(-array) โ†’ (real / integer)(real / integer)HTuple (double / Hlong)HPose, HTuple (double / int / long)Sequence[Union[float, int]]Htuple (double / Hlong)

3D pose of the object.

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)


*  Perform camera calibration (with standard calibration plate)
calibrate_cameras (CalibDataID, Error)
get_calib_data (CalibDataID, 'camera', 0, 'params', CamParam)
*  World coordinate system is defined by calibration plate in first image
get_calib_data (CalibDataID, 'calib_obj_pose',  [0,0], 'pose', \
                ObjInCameraPose)
*  Compensate thickness of plate
set_origin_pose(ObjInCameraPose, 0, 0, 0.0006, WorldPose)

* Create descriptor model:
create_calib_descriptor_model (Image,CamParam,WorldPose, \
                               '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_calib_descriptor_model (SearchImage,ModelID,[],[],[],[],0.2,1, \
                             CamParam,['num_points','inlier_ratio'], \
                             Pose,Score)

Combinations with other operators๐Ÿ”—

Combinations

Possible predecessors

create_calib_descriptor_modelCreateCalibDescriptorModel, read_descriptor_modelReadDescriptorModel

See also

vector_to_poseVectorToPose, points_lepetitPointsLepetit, create_calib_descriptor_modelCreateCalibDescriptorModel

Module๐Ÿ”—

Matching