国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

open3d 深度圖和點(diǎn)云數(shù)據(jù)互轉(zhuǎn),RGBD和點(diǎn)云互轉(zhuǎn)

這篇具有很好參考價值的文章主要介紹了open3d 深度圖和點(diǎn)云數(shù)據(jù)互轉(zhuǎn),RGBD和點(diǎn)云互轉(zhuǎn)。希望對大家有所幫助。如果存在錯誤或未考慮完全的地方,請大家不吝賜教,您也可以點(diǎn)擊"舉報違法"按鈕提交疑問。

1. 深度圖Image和點(diǎn)云

關(guān)鍵代碼:

(1) 深度圖轉(zhuǎn)點(diǎn)云

pcd = o3d.t.geometry.PointCloud.create_from_depth_image(depth=depth,
                                                        intrinsics=intrinsic,
                                                        depth_scale=5000.0,
                                                        depth_max=10.0)

需要知道相機(jī)內(nèi)外參數(shù)。?

(2) 點(diǎn)云轉(zhuǎn)深度圖

depth_reproj = pcd.project_to_depth_image(width=640,
                                          height=480,
                                          intrinsics=intrinsic,
                                          depth_scale=5000.0,
                                          depth_max=10.0)

?需要知道相機(jī)內(nèi)外參數(shù)。?

point_cloud_to_depth.py

import open3d as o3d
import numpy as np
import matplotlib.pyplot as plt

if __name__ == '__main__':
    # 1. read
    tum_data = o3d.data.SampleTUMRGBDImage()
    depth = o3d.t.io.read_image(tum_data.depth_path)  # Image

    # 2. depth Image生成PointCloud
    """
    create PointCloud from a depth image and a camera model.
    
    depth (open3d.t.geometry.Image): The input depth image should be a uint16_t image.
    intrinsics (open3d.core.Tensor): Intrinsic parameters of the camera. 相機(jī)內(nèi)參
    extrinsics (open3d.core.Tensor, optional): Extrinsic parameters of the camera. 相機(jī)外參
    depth_scale (float, optional, default=1000.0): The depth is scaled by 1 / depth_scale.
    depth_max (float, optional, default=3.0): Truncated at depth_max distance.
    ...params.
    
    """
    intrinsic = o3d.core.Tensor([[535.4, 0, 320.1], [0, 539.2, 247.6],
                                 [0, 0, 1]])
    pcd = o3d.t.geometry.PointCloud.create_from_depth_image(depth=depth,
                                                            intrinsics=intrinsic,
                                                            depth_scale=5000.0,
                                                            depth_max=10.0)
    o3d.visualization.draw([pcd])

    # 3. PointCloud生成depth Image
    depth_reproj = pcd.project_to_depth_image(width=640,
                                              height=480,
                                              intrinsics=intrinsic,
                                              depth_scale=5000.0,
                                              depth_max=10.0)

    fig, axs = plt.subplots(1, 2)
    axs[0].imshow(np.asarray(depth.to_legacy()))  # 原始depth
    axs[1].imshow(np.asarray(depth_reproj.to_legacy()))  # depth->ointCloud->depth
    plt.show()

open3d 深度圖和點(diǎn)云數(shù)據(jù)互轉(zhuǎn),RGBD和點(diǎn)云互轉(zhuǎn)

open3d 深度圖和點(diǎn)云數(shù)據(jù)互轉(zhuǎn),RGBD和點(diǎn)云互轉(zhuǎn)

2. RGBD和點(diǎn)云

深度圖-》RGBD-》點(diǎn)云

需要知道相機(jī)內(nèi)外參數(shù)。

point_cloud_to_rgbd.py

import open3d as o3d
import numpy as np
import matplotlib.pyplot as plt

if __name__ == '__main__':
    
    # 1. read depth and color image
    device = o3d.core.Device('CPU:0')
    tum_data = o3d.data.SampleTUMRGBDImage()
    depth = o3d.t.io.read_image(tum_data.depth_path).to(device)
    color = o3d.t.io.read_image(tum_data.color_path).to(device)
    # 2. depth and color 生成rgbd
    rgbd = o3d.t.geometry.RGBDImage(color, depth)
    
    # 3. rgbd生成pcd
    intrinsic = o3d.core.Tensor([[535.4, 0, 320.1], [0, 539.2, 247.6], [0, 0, 1]])
    pcd = o3d.t.geometry.PointCloud.create_from_rgbd_image(rgbd,
                                                           intrinsic,
                                                           depth_scale=5000.0,
                                                           depth_max=10.0)
    o3d.visualization.draw([pcd])
    
    # 4. pcd生成rgbd
    rgbd_reproj = pcd.project_to_rgbd_image(640,
                                            480,
                                            intrinsic,
                                            depth_scale=5000.0,
                                            depth_max=10.0)

    # 5. view
    fig, axs = plt.subplots(1, 2)
    axs[0].imshow(np.asarray(rgbd_reproj.color.to_legacy()))  # 原始rgbd
    axs[1].imshow(np.asarray(rgbd_reproj.depth.to_legacy()))  # rgbd->pcd->rgbd
    plt.show()

open3d 深度圖和點(diǎn)云數(shù)據(jù)互轉(zhuǎn),RGBD和點(diǎn)云互轉(zhuǎn)

open3d 深度圖和點(diǎn)云數(shù)據(jù)互轉(zhuǎn),RGBD和點(diǎn)云互轉(zhuǎn)文章來源地址http://www.zghlxwxcb.cn/news/detail-513675.html

到了這里,關(guān)于open3d 深度圖和點(diǎn)云數(shù)據(jù)互轉(zhuǎn),RGBD和點(diǎn)云互轉(zhuǎn)的文章就介紹完了。如果您還想了解更多內(nèi)容,請?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來自互聯(lián)網(wǎng)用戶投稿,該文觀點(diǎn)僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務(wù),不擁有所有權(quán),不承擔(dān)相關(guān)法律責(zé)任。如若轉(zhuǎn)載,請注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實(shí)不符,請點(diǎn)擊違法舉報進(jìn)行投訴反饋,一經(jīng)查實(shí),立即刪除!

領(lǐng)支付寶紅包贊助服務(wù)器費(fèi)用

相關(guān)文章

  • Open3D 降采樣:讓點(diǎn)云數(shù)據(jù)更加高效

    Open3D 降采樣:讓點(diǎn)云數(shù)據(jù)更加高效 點(diǎn)云數(shù)據(jù)處理是計(jì)算機(jī)視覺中重要的一項(xiàng)任務(wù),而點(diǎn)云數(shù)據(jù)本身就非常龐大,需要消耗大量的計(jì)算資源進(jìn)行處理。因此,點(diǎn)云數(shù)據(jù)的降采樣是非常必要的。Open3D 是一個面向三維數(shù)據(jù)處理的開源庫,提供了豐富的點(diǎn)云數(shù)據(jù)處理工具,其中包括

    2024年02月03日
    瀏覽(22)
  • Open3D點(diǎn)云數(shù)據(jù)處理(二十):最小二乘直線擬合(三維)

    專欄目錄:Open3D點(diǎn)云數(shù)據(jù)處理(Python) 最小二乘三維直線擬合的原理是通過最小化數(shù)據(jù)點(diǎn)到直線距離的平方和,找到最優(yōu)的直線模型來擬合給定數(shù)據(jù)集。這個距離是指數(shù)據(jù)點(diǎn)到直線的垂線距離。 三維直線通常表示為兩個平面的交線,形如 { A

    2024年02月12日
    瀏覽(68)
  • open3d,python-pcl,numpy 點(diǎn)云數(shù)據(jù)格式轉(zhuǎn)換

    NumPy 轉(zhuǎn) open3d.PointCloud 參考: https://www.codenong.com/cs106756630/ numpy轉(zhuǎn)open3D需要借助Vector3dVector函數(shù),這樣可以直接賦值與open3d.PointCloud.points,具體操作如下,假設(shè)(x, y, z)、(n_x, n_y, n_z)、(r, g, b)分別是一個n*3numpy數(shù)組(這三者不一定全部需要),則對于點(diǎn)數(shù),法向量和顏色的轉(zhuǎn)換都可以借

    2024年02月10日
    瀏覽(67)
  • 基于Open3D的點(diǎn)云處理17-Open3d的C++版本

    基于Open3D的點(diǎn)云處理17-Open3d的C++版本

    http://www.open3d.org/docs/latest/cpp_api.html http://www.open3d.org/docs/latest/getting_started.html#c http://www.open3d.org/docs/release/cpp_project.html#cplusplus-example-project https://github.com/isl-org/open3d-cmake-find-package https://github.com/isl-org/open3d-cmake-external-project https://github.com/isl-org/Open3D/releases Note: -DBUILD_SHARED_LIBS

    2024年02月09日
    瀏覽(47)
  • Open3D點(diǎn)云處理

    Open3D點(diǎn)云處理

    Open3D is an open-source library that supports rapid development of software that deals with 3D data. The Open3D frontend exposes a set of carefully selected data structures and algorithms in both C++ and Python. The backend is highly optimized and is set up for parallelization. Open3D是一個支持3D數(shù)據(jù)處理軟件快速開發(fā)的開源庫,在前端提供

    2023年04月17日
    瀏覽(25)
  • open3d點(diǎn)云平移

    open3d點(diǎn)云平移

    功能簡介 open3d中點(diǎn)云的平移函數(shù)為:pcd.translate((tx, ty, tz), relative=True)。當(dāng)relative為True時,(tx, ty, tz)表示點(diǎn)云平移的相對尺度,也就是平移了多少距離。當(dāng)relative為False時,(tx, ty, tz)表示點(diǎn)云中心(質(zhì)心)平移到的指定位置。質(zhì)心可以坐標(biāo)可以通過pcd.get_center()得到。 代碼

    2024年01月22日
    瀏覽(42)
  • Open3D點(diǎn)云數(shù)據(jù)處理(十九):最小二乘直線擬合(矩陣方程法)

    專欄目錄:Open3D點(diǎn)云數(shù)據(jù)處理(Python) 最小二乘直線擬合是一種常用的數(shù)據(jù)擬合方法,它的目標(biāo)是找到一條直線,使得該直線和樣本數(shù)據(jù)之間的誤差平方和最小。從矩陣方程的角度來看,最小二乘直線擬合可以看作是求解一個超定線性方程組的問題。 具體來說,我們假設(shè)有

    2024年02月13日
    瀏覽(50)
  • Open3d點(diǎn)云對象詳解

    Open3d點(diǎn)云對象詳解

    PointCloud 是open3d中用于點(diǎn)云處理的類,封裝了包括幾何變換、數(shù)據(jù)濾波、聚類分割等一系列實(shí)用算法。如無特別說明,本例中所有例程均基于斯坦福兔子的點(diǎn)云模型,下載地址:斯坦福標(biāo)準(zhǔn)模型 讀取和清除點(diǎn)云 一般點(diǎn)云數(shù)據(jù)的讀取方法屬于 open3d.io 的內(nèi)容,但點(diǎn)云類也提供了

    2023年04月19日
    瀏覽(53)

覺得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包