【三】3D匹配Matching之曲面匹配Surface—Based——find_surface_model()算子


😊😊😊欢迎来到本博客😊😊😊

🌟🌟🌟 Halcon算子太多,学习查找都没有系统的学习查找路径,本专栏主要分享Halcon各类算子含义及用法,有时间会更新具体案例。

😊😊😊 具体食用方式:可以点击本专栏【Halcon算子快速查找】–>搜索你要查询的算子名称;或者点击Halcon算子汇总博客,即可食用。

🎁🎁🎁支持:如果觉得博主的文章还不错或者您用得到的话,可以悄悄关注一下博主哈,如果三连收藏支持就更好啦!这就是给予我最大的支持!😙😙😙


学习目标

  • find_surface_model()

学习内容

算子简介

函数名解释
find_surface_model()从3D背景中找出最佳匹配。

1、find_surface_model()

  find_surface_model( : : SurfaceModelID, ObjectModel3D, RelSamplingDistance, KeyPointFraction, MinScore, ReturnResultHandle, GenParamName, GenParamValue : Pose, Score, SurfaceMatchingResultID)

  函数说明: 从3D背景中找出最佳匹配;

  函数参数:
    SurfaceModelID输入曲面匹配模型句柄;
    ObjectModel3D输入 3D目标对象;
    RelSamplingDistance输入 抽取样本与物体直径相关的距离;默认: 0.05;参考:0.1, 0.07, 0.05, 0.04, 0.03;范围:0 < RelSamplingDistance< 1;
    KeyPointFraction输入 抽取样本点作为关键点;默认: 0.2(20%);参考:0.3, 0.2, 0.1, 0.05;范围:0 < KeyPointFraction< 1;
    MinScore输入 搜索匹配目标的最小分数(相似度);默认: 0.7(70%);参考:0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0;范围:MinScore >= 0;
    ReturnResultHandle输入 是否返回曲面匹配目标;默认: ‘false’;参考:‘true’,‘false’;
    GenParamName输入 参数名;参考: ‘dense_pose_refinement’, ‘max_overlap_dist_abs’, ‘max_overlap_dist_rel’, ‘num_matches’, ‘pose_ref_dist_threshold_rel’, ‘pose_ref_num_steps’, ‘pose_ref_scoring_dist_abs’, ‘pose_ref_scoring_dist_rel’, ‘pose_ref_sub_sampling’, ‘pose_ref_use_scene_normals’, ‘scene_normal_computation’, ‘score_type’, ‘sparse_pose_refinement’;

参数说明

参数名解释
dense_pose_refinement启用或禁用密集姿态细化默认true
max_overlap_dist_abs此参数与参数’max_overlap_dist_rel’具有相同的效果。注意:与‘max_overlap_dist_rel’不同,‘max_overlap_dist_abs’的值被设置为绝对值。参考下面的“max_overlap_dist_rel”。注意:只应该设置参数’max_overlap_dist_rel’和’max_overlap_dist_abs’中的一个。如果同时设置了这两个参数,则只使用最后一个参数的值。参考:1、2、3
max_overlap_dist_rel可以使用’max_overlap_dist_rel指定两个匹配项的轴向对齐的边界框的中心之间的最小距离。该值是相对于对象的直径设置的。一旦找到一个得分高的对象,如果其边界框的中心太靠近第一个对象的中心,那么所有其他匹配项都将被取消。如果结果匹配必须不重叠,则’max_overlap_dist_rel’的值应设置为1.0。注意:只应该设置参数’max_overlap_dist_rel’和’max_overlap_dist_abs’中的一个。如果同时设置了这两个参数,则只使用最后一个参数的值。
num_matches设置返回的最大匹配数参考:1、2、5
pose_ref_dist_threshold_rel设置相对于表面模型直径的密集位姿细化距离阈值。只有比这个距离更接近目标的场景点才会被用于优化。更远的场景点被忽略。只能设置参数pose_ref_dist_threshold_relpose_ref_dist_threshold_abs中的一个。如果同时设置了这两个参数,则只使用最后一个参数的值。请注意,如果禁用密集姿态细化,则忽略此参数
pose_ref_num_steps密集姿态细化的迭代次数。增加迭代次数会导致以运行时为代价的更精确的布局。然而,一旦达到收敛,即使增加步数,精度也无法再提高。请注意,如果禁用密集姿态细化,则忽略此参数
pose_ref_scoring_dist_abs设置距离阈值进行评分。只有比这个距离更接近物体的场景点才被认为是“在模型上”。所有其他的场景点都被认为不在模型上。该值应与场景点坐标上的噪声量相对应。请注意,如果禁用密集姿态细化,则忽略此参数。只能设置参数‘pose_ref_scoring_dist_rel’和‘pose_ref_scoring_dist_abs’中的一个。如果同时设置了这两个参数,则只使用最后一个参数的值。
pose_ref_sub_sampling设置用于密集姿态细化的场景点的速率。例如,如果该值设置为5,则场景中的每5个点都用于姿态细化。该参数允许在姿态细化的速度和精度之间进行简单的权衡:增加该值会导致使用更少的点,从而导致更快但更不精确的姿态细化。降低该值具有相反的效果。请注意,如果禁用密集姿态细化,则忽略此参数
pose_ref_use_scene_normals启用或禁用使用场景法线进行姿态细化。如果启用了该参数,并且场景中包含点法线,那么这些法线将用于提高姿态细化的准确性。因此,降低了场景点法线方向与模型法线方向不同的场景点的影响。注意场景必须包含点法线。否则,此参数将被忽略
scene_normal_computation该参数控制采样场景的正常计算。在默认模式“快速”下,法线是基于一个小的点邻域来计算的。在模式“mls”中,法线的计算基于更大的邻域,并使用更复杂但更精确的“mls”方法。有关“mls”方法的更详细描述可以在操作符surface_normals_object_model_3d的描述中找到。“mls”模式针对的是噪声数据,比如飞行时间照相机拍摄的图像。
score_type设置返回的分数的类型。几个不同的分数可以计算和返回后的姿态细化。如果同时禁用稀疏和稠密位姿细分,则此参数无效。对于所有的分数类型,‘pose_ref_scoring_dist_rel’或‘pose_ref_scoring_dist_abs’控制场景点与模型点的距离,以便将其划分为模型点。
sparse_pose_refinement启用或禁用稀疏位姿细化参考:true’,‘false’.

    GenParamValue输入 对应参数名的值;参考: 0, 1, ‘true’, ‘false’, 0.005, 0.01, 0.03, 0.05, 0.1, ‘num_scene_points’, ‘model_point_fraction’, ‘num_model_points’, ‘fast’, ‘mls’;
    Pose输出 背景中曲面模型的3D姿势;
    Score输出 最佳匹配目标的得分;
    SurfaceMatchingResultID输出 曲面匹配目标;

Halcon例程

reconstruct_3d_object_model_for_matching.hdev	通过3D配准重建多视图匹配的3D对象模型
locate_pipe_joints_stereo.hdev					使用多视图立体和基于曲面的三维匹配定位管接头
inspect_3d_surface_intersections.hdev			通过检查三维对象的平面交点,检查安装凸耳的角度和尺寸
find_surface_model_noisy_data.hdev				在使用飞行时间(TOF)相机获取的嘈杂3D场景中,通过基于表面的匹配查找对象
find_surface_model.hdev							使用基于曲面的匹配在三维场景中查找对象
ensenso-nxlib_surface_based_3d_matching.hdev	使用NxLib界面(基于表面的3D匹配)
compare_surface_sheet_of_light.hdev				使用未校准的光片设置进行3D曲面比较
calibrate_sheet_of_light_3d_calib_object.hdev	使用3D校准对象校准一片光测量系统
calibrate_hand_eye_stationary_3d_sensor.hdev	使用固定3D传感器对手眼系统进行手眼校准

【3D匹配Matching之曲面匹配Surface—Based】 待更新算子

  • clear_surface_matching_result()/clear_all_surface_matching_results()
  • clear_surface_model()/clearr_all_surface_models()
  • create_surface_model()
  • deserialize_surface_model()
  • find_surface_model()
  • get_surface_matching_result()
  • get_surface_model_param()
  • read_surface_model()
  • refine_surface_model_pose()
  • serialize_surface_model()
  • write_surface_model()

汇总

  本专栏博客汇总:Halcon算子汇总


🚶🚶🚶今天的文章就到这里啦~
喜欢的话,点赞👍、收藏⭐️、关注💟哦 ~

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
The `find_shape_model` function in OpenCV is used for finding a shape model from a set of training images. It is part of the Shape Matching module in OpenCV, which provides tools for matching shapes based on their contour and other features. The `find_shape_model` function takes as input a set of training images, which are typically binary images with the object of interest represented as a white shape on a black background. The function then computes a shape model based on the contours of the objects in the training images. The shape model can be used for shape matching, which involves finding the best match between a given image and the shape model. This can be useful for object recognition and tracking. To use the `find_shape_model` function, you first need to create a ShapeContextDistanceExtractor object, which defines the distance metric used for shape matching. You then call the `find_shape_model` function, passing in the training images and the ShapeContextDistanceExtractor object. Here's an example of how to use the `find_shape_model` function: ``` import cv2 # Load training images img1 = cv2.imread("train1.png", cv2.IMREAD_GRAYSCALE) img2 = cv2.imread("train2.png", cv2.IMREAD_GRAYSCALE) img3 = cv2.imread("train3.png", cv2.IMREAD_GRAYSCALE) # Create ShapeContextDistanceExtractor object sc_extractor = cv2.createShapeContextDistanceExtractor() # Find shape model from training images shape_model = cv2.findShapeModel([img1, img2, img3], sc_extractor) ``` In this example, we load three training images and create a ShapeContextDistanceExtractor object. We then call the `findShapeModel` function, passing in the three training images and the ShapeContextDistanceExtractor object. The function returns a shape model, which can be used for shape matching.

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

cqy阳

预祝上岸,感谢打赏

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值