当前位置: 首页 > article >正文

halcon激光三角测量(二十三)inspect_3d_surface_intersections

目录

  • 一、inspect_3d_surface_intersections代码第一部分
  • 二、inspect_3d_surface_intersections代码第二部分
  • 三、inspect_3d_surface_intersections代码第三部分

一、inspect_3d_surface_intersections代码第一部分

1、创建一个未标定的激光三角测量模型
2、获得参考3D Model,创建一个基于表面匹配的模板

NumDisparityProfiles := 441
read_image (DisparityProfile, 'sheet_of_light/metal_part_1_disparity_line_000')
create_sheet_of_light_model (DisparityProfile, 'calibration', 'offset_scale', SheetOfLightModelID)
ScaleX := 1
ScaleY := 4
ScaleZ := 0.5
set_sheet_of_light_param (SheetOfLightModelID, 'scale_x', ScaleX)
set_sheet_of_light_param (SheetOfLightModelID, 'scale_y', ScaleY)
set_sheet_of_light_param (SheetOfLightModelID, 'scale_z', ScaleZ)set_profile_sheet_of_light (ImageModel, SheetOfLightModelID, [])
get_sheet_of_light_result_object_model_3d (SheetOfLightModelID, Model3DFull)
surface_normals_object_model_3d (Model3D, 'mls', 'mls_force_inwards', 'true', ObjectModel3DNormals)
triangulate_object_model_3d (ObjectModel3DNormals, 'greedy', 'greedy_remove_small_surfaces', 200, ObjectModel3DReference, Information)
create_surface_model (ObjectModel3DReference, 0.03, 'model_invert_normals', 'true', SurfaceModelID)

二、inspect_3d_surface_intersections代码第二部分

1、创建三个平面
2、将3D对象模型与平面相交
3、确定交点并将其转换为 XLD 轮廓

create_pose (300, 230, 250, -90, 0, 0, 'Rp+T', 'gba', 'point', PoseIntersectionPlane1)
create_pose (300, 900, 250, -90, 0, 0, 'Rp+T', 'gba', 'point', PoseIntersectionPlane2)
create_pose (300, 1570, 250, -90, 0, 0, 'Rp+T', 'gba', 'point', PoseIntersectionPlane3)
gen_plane_object_model_3d (PoseIntersectionPlane1, [-1, -1, 1, 1] * VisualizationPlaneSize, [-1, 1, 1, -1] * VisualizationPlaneSize, IntersectionPlane1)
gen_plane_object_model_3d (PoseIntersectionPlane2, [-1, -1, 1, 1] * VisualizationPlaneSize, [-1, 1, 1, -1] * VisualizationPlaneSize, IntersectionPlane2)
gen_plane_object_model_3d (PoseIntersectionPlane3, [-1, -1, 1, 1] * VisualizationPlaneSize, [-1, 1, 1, -1] * VisualizationPlaneSize, IntersectionPlane3)intersect_plane_object_model_3d (ObjectModel3DReference, PoseIntersectionPlane1, ObjectModel3DIntersection1)
intersect_plane_object_model_3d (ObjectModel3DReference, PoseIntersectionPlane2, ObjectModel3DIntersection2)
intersect_plane_object_model_3d (ObjectModel3DReference, PoseIntersectionPlane3, ObjectModel3DIntersection3)project_object_model_3d_lines_to_contour_xld (Intersection1, PoseIntersectionPlane1, ObjectModel3DIntersection1)
project_object_model_3d_lines_to_contour_xld (Intersection2, PoseIntersectionPlane2, ObjectModel3DIntersection2)
project_object_model_3d_lines_to_contour_xld (Intersection3, PoseIntersectionPlane3, ObjectModel3DIntersection3)
* 
* Determine the nominal dimensions and the tolerance limits by
* analysing the measurements from the reference sample
OrientationRef := 20
OrientationTolerance := 20
analyze_intersection (Intersection1, FittedLines1, OrientationRef, OrientationTolerance, MinDistance1, MaxDistance1, Angle1)
analyze_intersection (Intersection2, FittedLines2, OrientationRef, OrientationTolerance, MinDistance2, MaxDistance2, Angle2)
analyze_intersection (Intersection3, FittedLines3, OrientationRef, OrientationTolerance, MinDistance3, MaxDistance3, Angle3)
* 

下面是函数project_object_model_3d_lines_to_contour_xld (Intersection, PoseIntersectionPlane, ObjectModel3DIntersection)的实现过程
1、获取三维点集的直径,定义为最小外接轴平行长方体的对角线长度。
2、这里PoseIntersectionPlane为什么要invert:
输入的是PoseIntersectionPlane,平面在模型坐标系的姿态,取反就是模型在平面坐标系的姿态,平面坐标系,z上加个diameter看作相机坐标系。就是保证投影平面在相机前。这里其实随意加个数就可以,因为使用的是远心镜头参数,相当于垂直于这个平面去看这个轮廓。平面的中心对应图像中心原点。
3、采用分式模型生成一个远心镜头相机参数。
4、将一个三维物体模型投影到图像坐标系中.

pose_invert (PoseIntersectionPlane, PoseInvert)
get_object_model_3d_params (ObjectModel3DIntersection, 'diameter_axis_aligned_bounding_box', Diameter)
PoseInvert[2] := PoseInvert[2] + DiameterScale := 1
gen_cam_par_area_scan_telecentric_division (1.0, 0, 1.0 / Scale, 1.0 / Scale, 0, 0, 512, 512, CamParam)
project_object_model_3d (Intersection, ObjectModel3DIntersection, CamParam, PoseInvert, 'data', 'lines')
return ()

三、inspect_3d_surface_intersections代码第三部分

1、根据激光三角测量模型,获得3D模型,表面匹配,把平面变换到当前3D场景中。
2、获得模型和平面相机部分,投影到图像上,进行轮廓分析。

reset_sheet_of_light_model (SheetOfLightModelID)
read_image (ImageSearch, 'sheet_of_light/metal_part_' + (SceneIndex + 1) + '_disparity_line_' + Index$'03d')
set_profile_sheet_of_light (ImageSearch, SheetOfLightModelID, [])
get_sheet_of_light_result_object_model_3d (SheetOfLightModelID, Scene3DFull)
get_object_model_3d_params (Scene3DFull, 'bounding_box1', BoundingBox1)
MaxZ := BoundingBox1[5]
select_points_object_model_3d (Scene3DFull, 'point_coord_z', MinZ, MaxZ, Scene3D)
find_surface_model (SurfaceModelID, Scene3D, 0.005, 0.2, 0, 'false', [], [], Pose, Score, SurfaceMatchingResultID)
* Align the intersection planes to the test object
rigid_trans_object_model_3d (IntersectionPlane1, Pose, IntersectionPlane1Aligned)
rigid_trans_object_model_3d (IntersectionPlane2, Pose, IntersectionPlane2Aligned)
rigid_trans_object_model_3d (IntersectionPlane3, Pose, IntersectionPlane3Aligned)
get_object_model_3d_params (IntersectionPlane1Aligned, 'primitive_parameter_pose', IntersectionPlane1AlignedPose)
get_object_model_3d_params (IntersectionPlane2Aligned, 'primitive_parameter_pose', IntersectionPlane2AlignedPose)
get_object_model_3d_params (IntersectionPlane3Aligned, 'primitive_parameter_pose', IntersectionPlane3AlignedPose)disp_message (WindowHandle, Message[0:2], 'window', 12, 12, 'black', 'true')
triangulate_object_model_3d (Scene3D, 'greedy', [], [], Scene3DTest, Information)
dev_clear_window ()
disp_object_model_3d (WindowHandle, [Scene3DTest,IntersectionPlane1Aligned,IntersectionPlane2Aligned,IntersectionPlane3Aligned], VisualizationCamParam, VisualizationPose, ['color_1', 'color_2', 'color_3', 'alpha', 'alpha_0'], [VisualizationColors,0.75, 1])
Message := 'Test object ' + SceneIndex + ' with aligned intersection planes'
MessageWrapped := regexp_replace(Message + ' ',['(.{0,25})\\s', 'replace_all'],'$1\n')
disp_message (WindowHandle, MessageWrapped, 'window', 12, 12, 'black', 'true')intersect_plane_object_model_3d (Scene3DTest, IntersectionPlane1AlignedPose, ObjectModel3DIntersection1)
intersect_plane_object_model_3d (Scene3DTest, IntersectionPlane2AlignedPose, ObjectModel3DIntersection2)
intersect_plane_object_model_3d (Scene3DTest, IntersectionPlane3AlignedPose, ObjectModel3DIntersection3)project_object_model_3d_lines_to_contour_xld (Intersection1, IntersectionPlane1AlignedPose, ObjectModel3DIntersection1)
project_object_model_3d_lines_to_contour_xld (Intersection2, IntersectionPlane2AlignedPose, ObjectModel3DIntersection2)
project_object_model_3d_lines_to_contour_xld (Intersection3, IntersectionPlane3AlignedPose, ObjectModel3DIntersection3)analyze_intersection (Intersection1, FittedLines1, OrientationRef, OrientationTolerance, MinDistance1, MaxDistance1, Angle1)
analyze_intersection (Intersection2, FittedLines2, OrientationRef, OrientationTolerance, MinDistance2, MaxDistance2, Angle2)
analyze_intersection (Intersection3, FittedLines3, OrientationRef, OrientationTolerance, MinDistance3, MaxDistance3, Angle3)

相关文章:

halcon激光三角测量(二十三)inspect_3d_surface_intersections

目录 一、inspect_3d_surface_intersections代码第一部分二、inspect_3d_surface_intersections代码第二部分三、inspect_3d_surface_intersections代码第三部分 一、inspect_3d_surface_intersections代码第一部分 1、创建一个未标定的激光三角测量模型 2、获得参考3D Model&…...

数组和指针常见笔试题(深度剖析)

strlen和sizeof的区别 strlen是统计\0之前的字符个数&#xff0c;传递的是地址 sizeof是计算类型的字节数&#xff0c;其实在编译期间会通过类型来确定大小 下边我来讲一下常见的面试题&#xff0c;过程很详细放心观看 #include<stdio.h>#include <string.h>int …...

【Python爬虫(21)】从0到1:Python与MySQL的深度融合

【Python爬虫】专栏简介&#xff1a;本专栏是 Python 爬虫领域的集大成之作&#xff0c;共 100 章节。从 Python 基础语法、爬虫入门知识讲起&#xff0c;深入探讨反爬虫、多线程、分布式等进阶技术。以大量实例为支撑&#xff0c;覆盖网页、图片、音频等各类数据爬取&#xff…...

使用 Jetty 构建 HTTPS 服务入门指南

在互联网安全越来越重要的今天,使用 HTTPS 为 Web 服务提供安全传输成为标准配置。Jetty 是一个高性能、易用且功能丰富的开源 Java HTTP 服务器和 Servlet 容器,能够轻松实现 HTTPS 支持。本文将结合代码实例,引导您快速搭建一个基于 Jetty 的 HTTPS 服务。 一、Jetty 简介…...

网络通信-最大传输单元-MTU,网络安全零基础入门到精通实战教程!

文章目录 MTU 引用MTU 介绍 定义MTU 与 VLAN TagVLAN Tag 处理方式 IP分片可靠传输MTU 之 PMTUD PMTUD介绍IP头的DF分片位 DF 0 可以分片DF 1 不可以分片 注意事项 MTU 引用 以太网最初对报文长度没有限制&#xff0c;网络层最大可以接收65535个字节&#xff0c;但是以太…...

【如何学习商城源码】

学习商城源码是一个系统而深入的过程&#xff0c;需要掌握多种方法和技巧。以下是一些建议&#xff0c;帮助你有效地学习商城源码&#xff1a; 一、搭建学习环境 准备开发工具 编程语言相关&#xff1a;根据商城源码使用的编程语言&#xff0c;安装相应的集成开发环境&#xf…...

在nodejs中使用ElasticSearch(一)安装,使用

使用docker安装ElasticSearch和Kibana 1&#xff09;创建相应的data文件夹和子文件夹用来持久化ElasticSearch和kibana数据 2&#xff09;提前创建好elasticsearch配置文件 data/elasticsearch/config/elasticsearch.yml文件 # Elasticsearch Configuration # # NOTE: Elas…...

封装一个vue3控制并行任务数量的组合式函数

一. 使用场景 使用环境&#xff1a; vue3 当需要处理多个异步任务时&#xff0c;想要控制并行异步任务的数量&#xff0c;不想所有任务同时执行导致产生性能上的问题&#xff0c; 比如当需要同时发起多个网络请求&#xff0c;但又不想一次性发出过多请求导致服务器压力过大或…...

SpringSecurity请求流转的本质

1. SpringSecurity核心源码分析 分析SpringSecurity的核心原理,那么我们从哪开始分析?以及我们要分析哪些内容? 系统启动的时候SpringSecurity做了哪些事情?第一次请求执行的流程是什么?SpringSecurity中的认证流程是怎么样的?1.1 系统启动 当我们的Web服务启动的时候,…...

JavaScript数组-数组中新增元素

在JavaScript开发过程中&#xff0c;数组是一种非常常用的数据结构&#xff0c;它允许我们以有序的方式存储多个值。随着应用需求的变化&#xff0c;我们经常需要向现有的数组中添加新的元素。本文将详细介绍几种向数组中新增元素的方法&#xff0c;并探讨它们的特点和适用场景…...

【AI工具之Deepseek+Kimi一键免费生成PPT】

1.打开Deepseek网页&#xff1a;DeepSeek 2.使用Deepseek获得一份PPT大纲&#xff08;输入背景需求约束条件进行提问&#xff09;如下图&#xff1a; 3.复制Deepseek输出的PPT大纲 4.打开Kimi网页&#xff1a;Kimi.ai - 会推理解析&#xff0c;能深度思考的AI助手 5.在Kimi中…...

基于微信小程序的宿舍报修管理系统设计与实现,SpringBoot(15500字)+Vue+毕业论文+指导搭建视频

运行环境 jdkmysqlIntelliJ IDEAmaven3微信开发者工具 项目技术SpringBoothtmlcssjsjqueryvue2uni-app 宿舍报修小程序是一个集中管理宿舍维修请求的在线平台&#xff0c;为学生、维修人员和管理员提供了一个便捷、高效的交互界面。以下是关于这些功能的简单介绍&#xff1a; …...

ok113i平台——更改根目录分区大小

问题&#xff1a;根目录的空间太小&#xff1b;目前只有992M&#xff08;包含了home目录大小&#xff09; 通过改下面三个文件任一个&#xff0c;三个都会同时更改&#xff0c;以配置各分区容量: /home/forlinx/OK113i-linux-sdk/device/config/chips/t113_i/configs/ok113i/l…...

DeepSeek 助力 Vue 开发:打造丝滑的右键菜单(RightClickMenu)

前言&#xff1a;哈喽&#xff0c;大家好&#xff0c;今天给大家分享一篇文章&#xff01;并提供具体代码帮助大家深入理解&#xff0c;彻底掌握&#xff01;创作不易&#xff0c;如果能帮助到大家或者给大家一些灵感和启发&#xff0c;欢迎收藏关注哦 &#x1f495; 目录 Deep…...

IDEA CodeGPT 使用教程

IDEA CodeGPT 使用教程 CodeGPT 是一个 IntelliJ IDEA 插件&#xff0c;可以利用 OpenAI&#xff08;或自建 AI 模型&#xff09;来帮助开发者完成代码编写、优化、调试、解释错误等任务。以下是详细的安装与配置教程。 1. 安装 CodeGPT 插件 方式 1&#xff1a;从插件市场安…...

WLAN无线2.4G/5G频段划分和可用信道

互联网各领域资料分享专区(不定期更新)&#xff1a; Sheet...

HTML/CSS中后代选择器

1.作用:选中指定元素中,符合要求的后代元素. 2.语法:选择器1 选择器2 选择器3 ...... 选择器n(使用空格隔开) 3.举例: /* 选中ul中的所有li */ul li{color: red;}/* 选中类名为subject元素中的所有li */.subject li{color: blue;}/* 选中类名为subject元素中的所有类名为f…...

自己安装一台DeepSeek的服务器

找一台还可以的Linux服务器&#xff0c;登录后执行&#xff1a; curl -fsSL https://ollama.com/install.sh | sh 等待安装完成&#xff1a; 执行命令&#xff0c;根据服务器能力安装不同版本的AI模型&#xff1a; ollama run llama3.2 下一步就开始对话吧&#xff1a; llam…...

StableDiffusion学习笔记——4、模型下载和学习

目录   大家好&#xff0c;我是阿赵。   继续学习StableDiffusion的使用。   这次来学习一下模型的相关知识 一、 什么是模型 之前我们了解过&#xff0c;在StableDiffusion里面生成图片或者视频&#xff0c;都需要先选择模型。模型用通俗的话来说&#xff0c;就是决定了…...

蓝桥杯班级活动

题目描述 小明的老师准备组织一次班级活动。班上一共有 n 名 (n 为偶数) 同学&#xff0c;老师想把所有的同学进行分组&#xff0c;每两名同学一组。为了公平&#xff0c;老师给每名同学随机分配了一个 n 以内的正整数作为 id&#xff0c;第 i 名同学的 id 为 ai。 老师希望通…...

微软宣布 Windows 11 将不再免费升级:升级需趁早

大家都知道如果你现在是Windows 10 系统&#xff0c;其实可以免费升级到正版 Windows 11&#xff0c;只要你的电脑配置满足 TPM2.0要求。 而最近微软已经公布了 Windows 10 的最后支持时间&#xff0c;也就是今年10月14日&#xff0c;在这之后微软将不再对Windows 10负责&#…...

Java开发实习面试笔试题(含答案)

在广州一家中大公司面试&#xff08;BOSS标注是1000-9999人&#xff0c;薪资2-3k&#xff09;&#xff0c;招聘上写着Java开发&#xff0c;基本没有标注前端要求&#xff0c;但是到场知道是前后端分离人不分离。开始先让你做笔试&#xff08;12道问答4道SQL题&#xff09;&…...

什么叫不可变数据结构?

不可变数据结构(Immutable Data Structures)是指一旦创建之后,其内容就不能被修改的数据结构。这意味着任何对不可变数据结构的“修改”操作实际上都会返回一个新的数据结构,而原始数据结构保持不变。 一、不可变数据结构的核心特点 不可变性:一旦创建后,数据结构的内容…...

3D与2D机器视觉机械臂引导的区别

3D与2D机器视觉在机械臂引导中的主要区别如下&#xff1a; 数据维度 2D视觉&#xff1a;仅处理平面图像&#xff0c;提供X、Y坐标信息&#xff0c;无法获取深度&#xff08;Z轴&#xff09;数据。 3D视觉&#xff1a;处理三维空间数据&#xff0c;提供X、Y、Z坐标及物体的姿态…...

Effective Go-新手学习Go需要了解的知识

不知不觉从事Golang开发已有4+年了,回顾自己的成长经历,有很多感悟和心得。如果有人问我,学习Golang从什么资料开始,我一定给他推荐"Effective Go"。《Effective Go》是 Go 语言官方推荐的编程风格和最佳实践指南,其结构清晰,内容涵盖 Go 的核心设计哲学和常见…...

解析DrugBank数据库数据|Python

一、DrugBank 数据库简介 DrugBank 是一个综合性的生物信息学和化学信息学数据库&#xff0c;专门收录药物和靶点的详细信息。它由加拿大阿尔伯塔大学的 Wishart 研究组 维护&#xff0c;提供化学、药理学、相互作用、代谢、靶点等多方面的药物数据。DrugBank 结合了实验数据和…...

Day3 25/2/16 SUN

【一周刷爆LeetCode&#xff0c;算法大神左神&#xff08;左程云&#xff09;耗时100天打造算法与数据结构基础到高级全家桶教程&#xff0c;直击BTAJ等一线大厂必问算法面试题真题详解&#xff08;马士兵&#xff09;】https://www.bilibili.com/video/BV13g41157hK?p4&v…...

专题 - Java Stream API

概述 分类 数据源 任何位置。 如:集合、数组、文件、随机数、 Stream 静态工厂等。 支持的数据类型 整型、长整型、双精度浮点型基本数据类型。引用数据类型。流管道的数据处理流程 流管道必须要有终止操作。否则永不执行,只是一个静默的无操作指令。流管道是懒运算的。当执…...

【前端框架】vue2和vue3的区别详细介绍

Vue 3 作为 Vue 2 的迭代版本&#xff0c;在性能、语法、架构设计等多个维度均有显著的变革与优化。以下详细剖析二者的区别&#xff1a; 响应式系统 Vue 2 实现原理&#xff1a;基于 Object.defineProperty() 方法实现响应式。当一个 Vue 实例创建时&#xff0c;Vue 会遍历…...

大模型WebUI:Gradio全解11——使用transformers.agents构建Gradio UI(3)

大模型WebUI&#xff1a;Gradio全解11——使用transformers.agents构建Gradio UI&#xff08;3&#xff09; 前言本篇摘要11. 使用transformers.agents构建Gradio UI11.3 创建和使用工具Tools11.3.1 默认工具箱与load_tool11.3.2 创建新工具11.3.3 管理代理的工具箱toolbox11.3…...