Python-opencv读取深度图像

Python-opencv读取深度图像由于实验需要用到Kinect2.0采集的深度图像,但是用以下程序读取深度图片的时候显不方便观察temp_img=’cup_depth.png’depth_filename=os.path.join(image_dir,depth_img)temp_filename=os.path.join(image_dir,temp_img)im…

大家好,又见面了,我是你们的朋友全栈君。

由于实验需要用到Kinect2.0采集的深度图像,但是用以下程序读取深度图片的时候显不方便观察

    temp_img= 'cup_depth.png' 
    depth_filename = os.path.join(image_dir,depth_img) 
    temp_filename  = os.path.join(image_dir,temp_img)     
    imgOri = cv2.imread(depth_filename)      
    cv2.imshow('imgOri',depth) 
    cv2.waitKey(0)  

此时我们需要将程序稍作修改变为:

temp_img= 'cup_depth.png' 
depth_filename = os.path.join(image_dir,depth_img) 
temp_filename  = os.path.join(image_dir,temp_img)     
imgOri = cv2.imread(depth_filename, -1) 
depth=cv2.split(imgOri)[0]
depth[depth>800]=0
depth=depth/1000.0000
cv2.imshow('imgOri',depth) 
cv2.waitKey(0)     

此时通过cv2.imshow()便可以比较清晰的显示深度图像了
在这里插入图片描述

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/141978.html原文链接:https://javaforall.net

(0)
上一篇 2022年5月24日 下午6:20
下一篇 2022年5月24日 下午6:20


相关推荐

  • linux下ll命令_ubuntu bash命令

    linux下ll命令_ubuntu bash命令ubuntull命令1、用过Redhat或者Centos的朋友应该很熟悉ll这个命令,就相当于ls-l,但在Ubuntu中要么不能用,要么会显示隐藏文件,看起来很烦。2、严格来说ll不是一个命令,只是命令的别名而已。很多Linux用户都使用bashshell,对普通用户来说用得最多的就是命令补全(按tab键)和alias(别名)功能。Ubunt…

    2026年3月6日
    5
  • 私有IP地址的范围是多少?

    私有IP地址的范围是多少?公用地址由 InterNIC 负责分配 主要面向注册并向 InterNIC 提出申请的组织机构 主要有 A B C D E 五类地址 1 A 类 地址范围是 1 0 0 0 到 127 255 255 255 主要分配给大量主机而局域网网络数量较少的大型网络 2 B 类 地址范围是 128 0 0 0 到 191 255 255 255 一般用于国际性大公司和政府机构 3 C 类 地址范围是 192 0 0 0

    2026年3月17日
    2
  • 数据外连接 LEFT OUT JOIN 的用法

    数据外连接 LEFT OUT JOIN 的用法table1 与 table2 的等值连接如下 Select nbsp A id A name A housenumber B housenumber B housenamefro table2Bwhere housenumber B housenumber nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp

    2026年3月17日
    2
  • linux防ddos 软件下载,linux系统防ddos攻击工具

    linux防ddos 软件下载,linux系统防ddos攻击工具DDoSdeflate其实非常简单,下面是详细的安装和配置步骤:1.安装DDoSdeflatewgethttp://www.inetbase.com/scripts/ddos/install.shchmod0700install.sh./install.sh//弹出版权信息后,在SSH下键入q,即可退出版权信息。2.配置DDoSdeflate.安装成功后会提示Config…

    2022年7月14日
    15
  • Linux下Open函数

    Linux下Open函数文章目录Open介绍参数案例输出结果:文件描述符fdOpen介绍 Open函数用来打开一个文件,建立一个文件描述符到文件路径的映射,建立文件标识。 open函数原型如下所示:#include<fcntl.h>intopen(constchar*pathname,intflag,…);参数pathname是要打开或者创建的文件路径名,可以是绝对路径也…

    2022年5月26日
    35
  • React多页面跳转[通俗易懂]

    React多页面跳转[通俗易懂]render(){const{app:{locationQuery}}=this.props;////////////tolist.jsconst{子页面数据}=this.state;const{id}=locationQuery;///获取当前页面地址栏的idconstinfo=queryA…

    2022年5月30日
    37

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号