当前位置: 首页> 教育> 锐评 > 安徽网络营销_郑州百姓网招聘信息官网_seo网站建设_最近新闻事件

安徽网络营销_郑州百姓网招聘信息官网_seo网站建设_最近新闻事件

时间:2025/7/12 15:26:51来源:https://blog.csdn.net/qq_54708219/article/details/147396044 浏览次数:0次
安徽网络营销_郑州百姓网招聘信息官网_seo网站建设_最近新闻事件
import cv2# 1.读取一张深度图
depth_img = cv2.imread("Dataset_depth/images/train/1112_0-rgb.png", cv2.IMREAD_UNCHANGED)
print(depth_img.shape)
cv2.imshow("depth", depth_img)  # (960, 1280)
print(depth_img)# 读取一张rgb的图片做对比
input_path = "Dataset_rgb/images/train/1112_0-rgb.jpeg"
object_image = cv2.imread(input_path, cv2.IMREAD_UNCHANGED)
print(object_image.shape)
print(object_image)# 2.转换深度图, 将深度图转换为[0-255]范围更直观的表示形式显示
depth_normalized = cv2.convertScaleAbs(depth_img, alpha=255.0 / depth_img.max())# 3.显示深度图
cv2.imshow("depth_normalized", depth_normalized)
cv2.waitKey()

打印结果:

深度图:

shape: (960, 1280)
img:
[[0 0 0 ... 0 0 0][0 0 0 ... 0 0 0][0 0 0 ... 0 0 0]...[0 0 0 ... 0 0 0][0 0 0 ... 0 0 0][0 0 0 ... 0 0 0]]

RGB图:

shape: (960, 1280, 3)
img:
[[[17 21 16][17 21 16][18 22 17]...[14 17 15][15 18 16][15 18 16]][[16 20 15][16 20 15][17 21 16]...[15 18 16][15 18 16][15 18 16]][[16 20 15][16 20 15][17 21 16]...[15 18 16][15 18 16][15 18 16]]...[[11 14 12][11 14 12][11 14 12]...[10 10 10][11 11 11][11 11 11]][[12 15 13][12 15 13][12 15 13]...[10 10 10][11 11 11][11 11 11]][[12 15 13][12 15 13][12 15 13]...[11 11 11][11 11 11][11 11 11]]]

图片显示:

RGB原图(1280*960)
深度图原图(1280*960)
深度图(resize后)(1280*960)
关键字:安徽网络营销_郑州百姓网招聘信息官网_seo网站建设_最近新闻事件

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

责任编辑: