浙江省网站建设东莞设计网站公司

张小明 2026/3/2 19:56:55
浙江省网站建设,东莞设计网站公司,网站开发小组总结报告,站长之家查询域名一#xff1a;主要的知识点 1、说明 本文只是教程内容的一小段#xff0c;因博客字数限制#xff0c;故进行拆分。主教程链接#xff1a;vtk教程——逐行解析官网所有Python示例-CSDN博客 2、知识点纪要 本段代码主要涉及的有①ICP配算法的运用#xff0c;②运用ICP的…一主要的知识点1、说明本文只是教程内容的一小段因博客字数限制故进行拆分。主教程链接vtk教程——逐行解析官网所有Python示例-CSDN博客2、知识点纪要本段代码主要涉及的有①ICP配算法的运用②运用ICP的配准矩阵二代码及注释import vtkmodules.vtkRenderingOpenGL2 import vtkmodules.vtkInteractionStyle from vtkmodules.vtkCommonCore import vtkPoints from vtkmodules.vtkCommonDataModel import vtkCellArray, vtkPolyData, vtkIterativeClosestPointTransform from vtkmodules.vtkFiltersGeneral import vtkTransformPolyDataFilter # from vtkmodules.vtkFiltersSources import def main(): 原文写法 sourcePoints vtkPoints() sourceVertices vtkCellArray() sp_id sourcePoints.InsertNextPoint(1.0, 0.1, 0.0) # 返回为0 sourceVertices.InsertNextCell(1) sourceVertices.InsertCellPoint(sp_id) sp_id sourcePoints.InsertNextPoint(0.1, 1.1, 0.0) # 返回为1 sourceVertices.InsertNextCell(1) sourceVertices.InsertCellPoint(sp_id) sp_id sourcePoints.InsertNextPoint(0.0, 0.1, 1.0) # 返回为2 sourceVertices.InsertNextCell(1) sourceVertices.InsertCellPoint(sp_id) source vtkPolyData() source.SetPoints(sourcePoints) source.SetVerts(sourceVertices) 我觉得这种写法与一般示例的写法出入较大在这里重写 sourcePoints vtkPoints() sourcePoints.InsertNextPoint(1.0, 0.1, 0.0) sourcePoints.InsertNextPoint(0.1, 1.1, 0.0) sourcePoints.InsertNextPoint(0.0, 0.1, 1.0) sourceCells vtkCellArray() sourceCells.InsertNextCell(1, [0]) sourceCells.InsertNextCell(1, [1]) sourceCells.InsertNextCell(1, [2]) source vtkPolyData() source.SetPoints(sourcePoints) source.SetVerts(sourceCells) pointCount 3 for index in range(pointCount): point [0, 0, 0] sourcePoints.GetPoint(index, point) print(source point[%s]%s % (index, point)) # target_points。目标点位 targetPoints vtkPoints() targetPoints.InsertNextPoint(1, 0, 0) targetPoints.InsertNextPoint(0, 1, 0) targetPoints.InsertNextPoint(0, 0, 1) targetCells vtkCellArray() targetCells.InsertNextCell(1, [0]) targetCells.InsertNextCell(1, [1]) targetCells.InsertNextCell(1, [2]) target vtkPolyData() target.SetPoints(targetPoints) target.SetVerts(targetCells) pointCount 3 for index in range(pointCount): point [0, 0, 0] targetPoints.GetPoint(index, point) print(target point[%s]%s % (index, point)) # 构建icp icp vtkIterativeClosestPointTransform() icp.SetSource(source) icp.SetTarget(target) icp.GetLandmarkTransform().SetModeToRigidBody() # 设为刚体只能旋转和平移不能缩放 icp.SetMaximumNumberOfIterations(20) # 设置最大迭代次数为20 icp.StartByMatchingCentroidsOn() # 开启ICP算法的质心预匹配步骤它会在第一次迭代时先应用一个平移变换将源点云的质心移动到目标点云的质心位置 icp.Modified() # 通知 VTK 管道这个对象icp 变换对象的参数已被修改 icp.Update() vtkTransformPolyDataFilter 将一个 vtkPolyData 数据集应用几何变换然后生成一个新的、已变换的 vtkPolyData 对象 下面一段代码的含义是指将source乘以ipc得到的4x4配准矩阵 icpTransformFilter vtkTransformPolyDataFilter() icpTransformFilter.SetInputData(source) icpTransformFilter.SetTransform(icp) icpTransformFilter.Update() transformedSource icpTransformFilter.GetOutput() # display transformed points pointCount 3 for index in range(pointCount): point [0, 0, 0] transformedSource.GetPoint(index, point) print(transformed source point[%s]%s % (index, point)) if __name__ __main__: main()
版权声明:本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若内容造成侵权/违法违规/事实不符,请联系邮箱:809451989@qq.com进行投诉反馈,一经查实,立即删除!

在线手机动画网站模板下载密云建设网站公司

G-Star 开源摘星计划,简称 G-Star 计划,是 AtomGit 平台推出的针对开源项目成长全流程的扶持计划,我们为每一个申请加入 G-Star 计划的开源项目提供资源对接与运营支持:包括代码托管、品牌市场推广、社区化运营等。参与 G-Star 计…

张小明 2026/1/22 10:09:03 网站建设

网站建设公司济南深圳网络络推广培训

TrollInstallerX下载被拦截?这些方法让你顺利安装 【免费下载链接】TrollInstallerX A TrollStore installer for iOS 14.0 - 16.6.1 项目地址: https://gitcode.com/gh_mirrors/tr/TrollInstallerX 为什么每次下载TrollInstallerX时总被系统拦截&#xff1f…

张小明 2026/3/2 1:18:48 网站建设

便宜的做网站新闻资讯网站模板

3D模型骨骼绑定自动化革命:UniRig如何重塑动画制作流程 【免费下载链接】UniRig One Model to Rig Them All: Diverse Skeleton Rigging with UniRig 项目地址: https://gitcode.com/gh_mirrors/un/UniRig 传统3D模型骨骼绑定需要专业人员投入大量时间进行手…

张小明 2026/3/1 15:39:40 网站建设

企业门户网站需求分析传奇手游新开服网站

第一章:Open-AutoGLM报销单据提交在企业自动化流程中,Open-AutoGLM 是一款基于大语言模型的智能报销处理系统,支持用户通过结构化方式提交报销单据。该系统能够自动识别票据类型、提取关键字段,并完成合规性校验。准备报销数据 提…

张小明 2026/3/1 19:35:01 网站建设

做服务网站发展背景莱芜网站优化公司

终极指南:electerm主题编辑器高级功能之渐变背景与透明度设置 【免费下载链接】electerm 📻Terminal/ssh/telnet/serialport/sftp client(linux, mac, win) 项目地址: https://gitcode.com/gh_mirrors/el/electerm 想要让你的electerm终端界面焕然…

张小明 2026/3/2 12:03:31 网站建设