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

市政府网站集约化建设难点如何优化关键词排名到首页

市政府网站集约化建设难点,如何优化关键词排名到首页,漯河北京网站建设公司,泉州市建设网站左右眼图片 需求 需要将左右眼图像利用视差生成三维点云数据 先问问chatGPT相关知识 进一步问有没有现成的软件 chatGPT提到了OpenCV,我们让chatGPT用OpenCV写一个程序来做这个事情 当然,代码里面会有一些错误,chatGPT写的代码并不会做模…

左右眼图片
在这里插入图片描述
需求
需要将左右眼图像利用视差生成三维点云数据

先问问chatGPT相关知识
在这里插入图片描述
进一步问有没有现成的软件
在这里插入图片描述
chatGPT提到了OpenCV,我们让chatGPT用OpenCV写一个程序来做这个事情
在这里插入图片描述
当然,代码里面会有一些错误,chatGPT写的代码并不会做模拟运行测试,所以,实际跑起来是会有一些错误的
在这里插入图片描述
我们打印了一下,是float64的数据类型
在这里插入图片描述
转成float32就可以了,这可能是本地库版本问题造成的,也不能算chatGPT写的代码有错

运行python程序,生成output.ply点云文件,用CloudCompare软件打开看一下生成的点云
在这里插入图片描述
如果只有两张图,生成的点云是有很多缺失的,如果通过左右眼立体视频,也许可以补全很多信息,chatGPT给出一些解决思路
在这里插入图片描述
附:完整代码

import cv2
import numpy as npdef create_output(vertices, colors, filename):colors = colors.reshape(-1, 3)vertices = np.hstack([vertices.reshape(-1, 3), colors])ply_header = '''plyformat ascii 1.0element vertex %(vert_num)dproperty float xproperty float yproperty float zproperty uchar redproperty uchar greenproperty uchar blueend_header'''with open(filename, 'w') as f:f.write(ply_header % dict(vert_num=len(vertices)))np.savetxt(f, vertices, '%f %f %f %d %d %d')# Load the left and right images in gray scale
imgLeft = cv2.imread('imL.bmp', cv2.IMREAD_GRAYSCALE)
imgRight = cv2.imread('imR.bmp', cv2.IMREAD_GRAYSCALE)
imgColor = cv2.imread('imL.bmp', cv2.IMREAD_COLOR)# Create a StereoBM object
stereo = cv2.StereoBM_create(numDisparities=16, blockSize=15)# Compute the disparity map
disparity = stereo.compute(imgLeft, imgRight)# Normalize the disparity map
norm_coeff = 255 / disparity.max()
disparity = disparity * norm_coeff / 255# Reproject the disparity map into 3D
h, w = imgLeft.shape[:2]
f = 0.8*w                          # guess for focal length
Q = np.float32([[1, 0, 0, -0.5*w],[0,-1, 0,  0.5*h],  # turn points 180 deg around x-axis,[0, 0, 0,     -f],  # so that y-axis looks up[0, 0, 1,      0]])
print(disparity.dtype)
disparity = np.float32(disparity)points = cv2.reprojectImageTo3D(disparity, Q)# Save the point cloud as a .ply file
colors = imgColor
mask = disparity > disparity.min()
output_points = points[mask]
output_colors = colors[mask]
mask = np.isfinite(output_points).all(axis=1)
output_points = output_points[mask]
output_colors = output_colors[mask]
output_file = 'output.ply'
print(output_points.dtype, output_colors.dtype)
print(output_points.shape, output_colors.shape)
create_output(output_points, output_colors, output_file)
http://www.ritt.cn/news/61.html

相关文章:

  • 邵阳做网站价格广州网络seo公司
  • pvc建筑模板生产厂家seo搜索排名
  • 青岛网站制作永诚百度登录入口
  • 嵊州网站汕头疫情最新消息
  • 建公司网站要多少钱如何做好网站站内优化
  • 网站建设论文摘要百度seo营销
  • 怎么看得出网站是哪个公司做的最近一周新闻大事
  • wordpress 图片灯箱网站推广优化是什么意思
  • 常用的网站推广方法有哪些苏州seo关键词优化软件
  • 网站做公司外贸营销型网站设计
  • 网站服务器错误怎么解决做网站要多少钱
  • 网站建设合同 英文电商网站建设 网站定制开发
  • win7网站后台无法编辑国内好用的搜索引擎
  • 邢台住房与城乡建设部网站大型门户网站建设
  • 微客到分销系统win10优化大师有用吗
  • 做网站图片切图是什么做网站比较好的公司有哪些
  • 人才微网站开发站长素材网站官网
  • 做一回最好的网站西安网站seo价格
  • 优秀网站界面设计代做百度首页排名价格
  • 长安网站建设营销推广费用预算表
  • 怎么在中国做网站赌博长春网站优化页面
  • 北京公司网站建设定微信上如何投放广告
  • 深圳宝安美容医院网站建设实体店100个营销策略
  • 网页设计入门教程pdfseo网站优化方案案例
  • 网站开发 价格差异百度商家
  • 专业搭建网站查权重
  • 网站建设运营维护方案最大免费发布平台
  • WordPress朗读seo网络科技有限公司
  • 海口建设厅网站中国搜索引擎排名
  • 基于分布式控件的网站开发框架网上教育培训机构排名