find_generic_shape_modelT_find_generic_shape_modelFindGenericShapeModelFindGenericShapeModelfind_generic_shape_model (算子)

名称

find_generic_shape_modelT_find_generic_shape_modelFindGenericShapeModelFindGenericShapeModelfind_generic_shape_model — 在图像中查找一个或多个形状模型的最佳匹配。

签名

find_generic_shape_model(SearchImage : : ModelID : MatchResultID, NumMatchResult)

Herror T_find_generic_shape_model(const Hobject SearchImage, const Htuple ModelID, Htuple* MatchResultID, Htuple* NumMatchResult)

void FindGenericShapeModel(const HObject& SearchImage, const HTuple& ModelID, HTuple* MatchResultID, HTuple* NumMatchResult)

static HGenericShapeModelResult HShapeModel::FindGenericShapeModel(const HObject& SearchImage, const HShapeModelArray& ModelID, Hlong* NumMatchResult)

HGenericShapeModelResult HShapeModel::FindGenericShapeModel(const HObject& SearchImage, Hlong* NumMatchResult) const

Hlong HGenericShapeModelResult::FindGenericShapeModel(const HObject& SearchImage, const HShapeModelArray& ModelID)

Hlong HGenericShapeModelResult::FindGenericShapeModel(const HObject& SearchImage, const HShapeModel& ModelID)

HGenericShapeModelResult HImage::FindGenericShapeModel(const HShapeModelArray& ModelID, Hlong* NumMatchResult) const

HGenericShapeModelResult HImage::FindGenericShapeModel(const HShapeModel& ModelID, Hlong* NumMatchResult) const

static void HOperatorSet.FindGenericShapeModel(HObject searchImage, HTuple modelID, out HTuple matchResultID, out HTuple numMatchResult)

static HGenericShapeModelResult HShapeModel.FindGenericShapeModel(HObject searchImage, HShapeModel[] modelID, out int numMatchResult)

HGenericShapeModelResult HShapeModel.FindGenericShapeModel(HObject searchImage, out int numMatchResult)

int HGenericShapeModelResult.FindGenericShapeModel(HObject searchImage, HShapeModel[] modelID)

int HGenericShapeModelResult.FindGenericShapeModel(HObject searchImage, HShapeModel modelID)

HGenericShapeModelResult HImage.FindGenericShapeModel(HShapeModel[] modelID, out int numMatchResult)

HGenericShapeModelResult HImage.FindGenericShapeModel(HShapeModel modelID, out int numMatchResult)

def find_generic_shape_model(search_image: HObject, model_id: MaybeSequence[HHandle]) -> Tuple[HHandle, int]

描述

算子 find_generic_shape_modelfind_generic_shape_modelFindGenericShapeModelFindGenericShapeModelFindGenericShapeModelfind_generic_shape_model finds the best instances of one or multiple shape models passed in ModelIDModelIDModelIDModelIDmodelIDmodel_id in the input image SearchImageSearchImageSearchImageSearchImagesearchImagesearch_image. The found matches are returned in MatchResultIDMatchResultIDMatchResultIDMatchResultIDmatchResultIDmatch_result_id and can be queried using get_generic_shape_model_resultget_generic_shape_model_resultGetGenericShapeModelResultGetGenericShapeModelResultGetGenericShapeModelResultget_generic_shape_model_result and get_generic_shape_model_result_objectget_generic_shape_model_result_objectGetGenericShapeModelResultObjectGetGenericShapeModelResultObjectGetGenericShapeModelResultObjectget_generic_shape_model_result_object。The number of found matches is returned in NumMatchResultNumMatchResultNumMatchResultNumMatchResultnumMatchResultnum_match_result. The model can be parameterized using set_generic_shape_model_paramset_generic_shape_model_paramSetGenericShapeModelParamSetGenericShapeModelParamSetGenericShapeModelParamset_generic_shape_model_param and set_generic_shape_model_objectset_generic_shape_model_objectSetGenericShapeModelObjectSetGenericShapeModelObjectSetGenericShapeModelObjectset_generic_shape_model_object, through which one can control the search.

The domain of the input image SearchImageSearchImageSearchImageSearchImagesearchImagesearch_image sets the ROI for the search. It limits the search space as it is considered as boundary for the center of gravity of ModelIDModelIDModelIDModelIDmodelIDmodel_id in order to accelerate the matching process. For information on passing a tuple of images to SearchImageSearchImageSearchImageSearchImagesearchImagesearch_image see below. Furthermore, the search space is limited by the size of SearchImageSearchImageSearchImageSearchImagesearchImagesearch_image. By default, ModelIDModelIDModelIDModelIDmodelIDmodel_id is only searched within those points of the domain, in which ModelIDModelIDModelIDModelIDmodelIDmodel_id fits completely. Hence, ModelIDModelIDModelIDModelIDmodelIDmodel_id will not be found if it exceeds the border of the image. This holds for all levels of the used image pyramid.

In rare cases which typically occur for artificial images, instances of ModelIDModelIDModelIDModelIDmodelIDmodel_id cannot be found in an image, if they touch the border of the domain on any level of the image pyramid. As a rule of thumb, ModelIDModelIDModelIDModelIDmodelIDmodel_id might not be found if its distance to an image border is smaller than pixels (where is the number of pyramid levels). This behavior can be changed with 'border_shape_models'"border_shape_models""border_shape_models""border_shape_models""border_shape_models""border_shape_models", see set_generic_shape_model_paramset_generic_shape_model_paramSetGenericShapeModelParamSetGenericShapeModelParamSetGenericShapeModelParamset_generic_shape_model_param

When searching multiple models, the search space can be restricted for all models simultaneously by passing a single image with reduced domain in SearchImageSearchImageSearchImageSearchImagesearchImagesearch_image

Alternatively, the search space can be restricted for each model individually by passing an object containing multiple image objects, one for each model in ModelIDModelIDModelIDModelIDmodelIDmodel_id. The search space is determined by the domain of the corresponding image. Except the domain, the images have to be identical, i.e., the pointers of the image objects need to refer to the same image (thus they need to be identical). The pointers can be checked using get_image_pointer1get_image_pointer1GetImagePointer1GetImagePointer1GetImagePointer1get_image_pointer1

When applying multiple models, different identifiers ('model_identifier'"model_identifier""model_identifier""model_identifier""model_identifier""model_identifier") have to be set for each model, so that each instance can be assigned to the shape model it has been found with.否则将抛出异常。

执行信息

此算子返回一个句柄。请注意,即使该句柄被用作特定算子的输入参数,这些算子仍可能改变此句柄类型的实例状态。

此算子支持取消超时和中断。

此算子修改后续输入参数的状态:

在执行此算子时,若该参数值需在多个线程间使用,则必须对其访问进行同步。

参数

SearchImageSearchImageSearchImageSearchImagesearchImagesearch_image (输入对象)  (multichannel-)object(-array) objectHObjectHObjectHObjectHobject

Image in which the model is searched.

ModelIDModelIDModelIDModelIDmodelIDmodel_id (输入控制,状态被修改)  shape_model(-array) HShapeModel, HTupleMaybeSequence[HHandle]HTupleHtuple (handle) (IntPtr) (HHandle) (handle)

形状模型的句柄。

MatchResultIDMatchResultIDMatchResultIDMatchResultIDmatchResultIDmatch_result_id (输出控制)  generic_shape_model_result HGenericShapeModelResult, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

Handle with the found matches.

NumMatchResultNumMatchResultNumMatchResultNumMatchResultnumMatchResultnum_match_result (输出控制)  integer HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Number of found matches.

结果

如果参数有效,算子 find_generic_shape_modelfind_generic_shape_modelFindGenericShapeModelFindGenericShapeModelFindGenericShapeModelfind_generic_shape_model 返回值 2 ( H_MSG_TRUE )。如有必要,则抛出异常。

可能的前趋

train_generic_shape_modeltrain_generic_shape_modelTrainGenericShapeModelTrainGenericShapeModelTrainGenericShapeModeltrain_generic_shape_model, set_generic_shape_model_paramset_generic_shape_model_paramSetGenericShapeModelParamSetGenericShapeModelParamSetGenericShapeModelParamset_generic_shape_model_param

模块

匹配