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

Open3D點(diǎn)云處理

這篇具有很好參考價(jià)值的文章主要介紹了Open3D點(diǎn)云處理。希望對(duì)大家有所幫助。如果存在錯(cuò)誤或未考慮完全的地方,請(qǐng)大家不吝賜教,您也可以點(diǎn)擊"舉報(bào)違法"按鈕提交疑問。

Open3D點(diǎn)云處理


一、Open3D

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是一個(gè)支持3D數(shù)據(jù)處理軟件快速開發(fā)的開源庫,在前端提供了一組精挑細(xì)選的C++和Python數(shù)據(jù)結(jié)構(gòu)與算法。并且在后端高度優(yōu)化且支持并行化。

核心要素包括:

  • 3D數(shù)據(jù)結(jié)構(gòu)
  • 3D數(shù)據(jù)處理算法
  • 場景重建
  • 3D可視化
  • 3D機(jī)器學(xué)習(xí)等

Python版快速安裝

需要的環(huán)境為:

  • OS:Ubuntu 18.04+、macOS 10.15+、Windows 10(64-bit)
  • Python: 3.6-3.9
  • Pre-packages: pip and conda
# Install
pip install open3d

# Verify installation
python -c "import open3d as o3d; print(o3d.__version__)"

# Python API
python -c "import open3d as o3d; \
           mesh = o3d.geometry.TriangleMesh.create_sphere(); \
           mesh.compute_vertex_normals(); \
           o3d.visualization.draw(mesh, raw_mode=True)"

# Open3D CLI
open3d example visualization/draw

二、Open3D點(diǎn)云加載與顯示

2.1 點(diǎn)云讀取

Open3D提供了直接從文件中讀取點(diǎn)云數(shù)據(jù)的API:

open3d.io.read_point_cloud(filename, format='auto', remove_nan_points=False, \
remove_infinite_points=False, print_progress=False)

Parameters

  • filename (str) – 文件路徑
  • format (str,optional,default=‘a(chǎn)uto’) – 文件的格式,默認(rèn)是auto,將影響如何讀取文件
  • remove_nan_points (bool*,* optional*,* default=False) – 是否移除值為nan的點(diǎn)
  • remove_infinite_points (bool*,* optional*,* default=False) – 是否移除值為inf的點(diǎn)
  • print_progress (bool*,* optional*,* default=False) – 當(dāng)該值為True時(shí),將會(huì)在可視化時(shí)出現(xiàn)一個(gè)過程條

Return

  • open3d.geometry.PointCloud對(duì)象

其中,format參數(shù)的可選參數(shù)為:

格式 描述
xyz 每一行包含[x,y,z]
xyzn 每一行包含[x,y,z,nx,ny,nz]
xyzrgb 每一行包括[x,y,z,r,g,b] rgb為[0,1]之間的float類型
pts 第一行表示點(diǎn)數(shù),之后每行包括[x,y,z,i,r,g,b] rgb為unit8類型
ply ply文件
pcd pcd文件

我們來嘗試讀取一下數(shù)據(jù)

import open3d as o3d

pcd=o3d.io.read_point_cloud(r"Cloud.pcd")
print(pcd)

'''
PointCloud with 2001009 points.
'''
# 此時(shí)點(diǎn)云數(shù)據(jù)已經(jīng)被讀入了

當(dāng)然,對(duì)于某些格式稀奇古怪的,我們也可以通過轉(zhuǎn)成ndarray然后再進(jìn)行讀?。?/p>

import numpy as np
import open3d as o3d

# 讀取到ndarray
data=np.genfromtxt(r'modelnet40_normal_resampled\airplane\airplane_0001.txt',delimiter=",")
# 創(chuàng)建PointCloud類
pcd=o3d.geometry.PointCloud()
pcd.points=o3d.utility.Vector3dVector(data[:,:3])
print(pcd)

'''
PointCloud with 10000 points.
'''

關(guān)于PointCloud的屬性,主要有以下四類:

  • colors: 顏色信息,在可視化時(shí)能為幾何體賦予視覺信息
  • covariances: 協(xié)方差
  • normal: 法向量
  • points: 位置信息

2.2 點(diǎn)云可視化

在Open3D中,點(diǎn)云可視化其中之一的API為:

draw_geometries(geometry_list, window_name=’Open3D’, width=1920,\
 height=1080, left=50, top=50, point_show_normal=False,\
  mesh_show_wireframe=False, mesh_show_back_face=False,\
   lookat, up, front, zoom)

Parameters

  • geometry_list (List[open3d.geometry.Geometry]) – 需要可視化的幾何體列表.
  • window_name (str, optional, default=‘Open3D’) – 窗口名稱
  • width (int, optional, default=1920) – 窗口寬度
  • height (int, optional, default=1080) – 窗口高度
  • left (int, optional, default=50) – 窗口左邊界
  • top (int, optional, default=50) – 窗口頂部邊界
  • point_show_normal (bool, optional, default=False) – 是否展示法向量
  • mesh_show_wireframe (bool, optional, default=False) – 是否可視化網(wǎng)格線框
  • mesh_show_back_face (bool, optional, default=False) – 同時(shí)可視化格網(wǎng)三角形背部
  • **lookat ** (numpy.ndarray[float64[3,1]]) – 相機(jī)注視向量
  • up (numpy.ndarray[float64[3,1]]) – 相機(jī)的上方向向量
  • front (numpy.ndarray[float64[3,1]]) – 相機(jī)的前矢量
  • zoom (float) – 相機(jī)縮放倍數(shù)

Returns

  • None

我們來嘗試一下:

o3d.visualization.draw_geometries([pcd])

Open3D點(diǎn)云處理

顯示法向量:

pcd.normals=o3d.utility.Vector3dVector(data[:,3:])
o3d.visualization.draw_geometries([pcd],window_name="o3d",width=1920,height=1080,
                                  left=50,top=50,point_show_normal=True)

Open3D點(diǎn)云處理

看起來跟毛毛蟲一樣…

提供了一組用戶交互指令:

-- Mouse view control --
  Left button + drag         : Rotate.
  Ctrl + left button + drag  : Translate.
  Wheel button + drag        : Translate.
  Shift + left button + drag : Roll.
  Wheel                      : Zoom in/out.

-- Keyboard view control --
  [/]          : Increase/decrease field of view.
  R            : Reset view point.
  Ctrl/Cmd + C : Copy current view status into the clipboard.
  Ctrl/Cmd + V : Paste view status from clipboard.

-- General control --
  Q, Esc       : Exit window.
  H            : Print help message.
  P, PrtScn    : Take a screen capture.
  D            : Take a depth capture.
  O            : Take a capture of current rendering settings.

Open3D點(diǎn)云處理
Open3D點(diǎn)云處理

也可以指定點(diǎn)云的顏色:

pcd.colors=o3d.utility.Vector3dVector(data[:,3:])

Open3D點(diǎn)云處理

參數(shù)geometry_list支持多個(gè)空間集合對(duì)象:

def read_txt(path):
    data=np.genfromtxt(path,delimiter=",")
    pcd=o3d.geometry.PointCloud()
    pcd.points = o3d.utility.Vector3dVector(data[:, :3])
    pcd.normals = o3d.utility.Vector3dVector(data[:, 3:])
    pcd.colors = o3d.utility.Vector3dVector(data[:, 3:])
    return pcd

path=r'\airplane'
pcd1=read_txt(path+r"\airplane_0001.txt")
pcd2=read_txt(path+r"\airplane_0012.txt")
o3d.visualization.draw_geometries([pcd1,pcd2],window_name="o3d",width=1920,height=1080,
                                  left=50,top=50,mesh_show_back_face=True)

Open3D點(diǎn)云處理

o3d提供了自動(dòng)計(jì)算法向量的API:

radius=0.01 # 搜索半徑
max_nn=30 # 鄰域內(nèi)用于估算法線的最大點(diǎn)數(shù)
# 執(zhí)行KD樹搜索
pcd1.estimate_normals(search_param=o3d.geometry.KDTreeSearchParamHybrid(radius,max_nn))
o3d.visualization.draw_geometries([pcd1],window_name="o3d",width=1920,height=1080,
                                  left=50,top=50,point_show_normal=True)
# 同樣能用KD樹構(gòu)建協(xié)方差表

2.3 點(diǎn)云保存

API如下:

open3d.io.write_point_cloud(filename, pointcloud, write_ascii=False, compressed=False, print_progress=False)

Parameters

  • filename (str) – 文件路徑
  • pointcloud (open3d.geometry.PointCloud) – 點(diǎn)云對(duì)象
  • write_ascii (booloptional,default=False) – 該參數(shù)為True時(shí),將會(huì)寫入ASCII碼,否則一般寫入二進(jìn)制文件
  • compressed (bool,optional,default=False) – 是否以壓縮格式進(jìn)行輸出
  • print_progress (bool,optional,default=False) –是否在控制臺(tái)打印一個(gè)進(jìn)度條

Returns

  • bool
o3d.io.write_point_cloud("02.pcd",pcd2,write_ascii=True)

此時(shí)可以看到已經(jīng)將讀取的點(diǎn)云寫入到文件中了。

Open3D點(diǎn)云處理


三、Open3D點(diǎn)云常見操作

3.1 體素下采樣

體素下采樣(Voxel downsampling)采用規(guī)則體素格網(wǎng)從輸入點(diǎn)云中創(chuàng)建分布均勻的下采樣點(diǎn)云,是許多點(diǎn)云處理任務(wù)的預(yù)處理步驟。該算法主要分為兩步:

  • 創(chuàng)建指定大小(分辨率)的體素網(wǎng)絡(luò)
  • 當(dāng)點(diǎn)云中至少有一個(gè)點(diǎn)落在某個(gè)體素內(nèi),則認(rèn)為該體素被占用,體素的顏色(屬性)是該體素內(nèi)所有點(diǎn)的平均值
print("Downsample the point cloud with a voxel of 0.05")
downpcd = pcd1.voxel_down_sample(voxel_size=0.05)
o3d.visualization.draw_geometries([downpcd])
print("The number of PC is : ",pcd1)
print("The number of downPC is : ",downpcd)


'''
Downsample the point cloud with a voxel of 0.05
The number of PC is :  PointCloud with 10000 points.
The number of downPC is :  PointCloud with 1389 points.

Downsample the point cloud with a voxel of 0.005
The number of PC is :  PointCloud with 10000 points.
The number of downPC is :  PointCloud with 9825 points.
'''

Open3D點(diǎn)云處理
Open3D點(diǎn)云處理

3.2 點(diǎn)云正態(tài)估計(jì)

在交互頁面,可以通過N查看點(diǎn)法線,+,-控制法線長度。

作為點(diǎn)云的基本操作之一,點(diǎn)云正態(tài)估計(jì)通過指定算法參數(shù)估測每個(gè)點(diǎn)可能的法向量,estimate_normals查找指定搜索半徑內(nèi)的臨近點(diǎn),通過這些臨近點(diǎn)的協(xié)方差計(jì)算其主軸,從而估計(jì)法向量。正常情況下會(huì)產(chǎn)生兩個(gè)方向相反的法向量,在不知道幾何體的全局結(jié)構(gòu)下,兩者都可以是正確的。Open3D會(huì)嘗試調(diào)整法線的方向,使其與原始法線對(duì)齊。

print("Recompute the normal of the downsampled point cloud")
downpcd.estimate_normals(
    search_param=o3d.geometry.KDTreeSearchParamHybrid(radius=0.1, max_nn=30))
o3d.visualization.draw_geometries([downpcd],
                                  zoom=0.3412,
                                  front=[0.4257, -0.2125, -0.8795],
                                  lookat=[2.6172, 2.0475, 1.532],
                                  up=[-0.0694, -0.9768, 0.2024],
                                  point_show_normal=True)

Open3D點(diǎn)云處理

如果想要訪問頂點(diǎn)法線的話,可以直接通過索引獲?。?/p>

print("Print a normal vector of the 0th point")
print(downpcd.normals[0])

'''
Print a normal vector of the 0th point
[ 0.99552379 -0.03798043  0.08654404]
'''

也可以將其轉(zhuǎn)為numpy數(shù)組:

print("Print the normal vectors of the first 10 points")
print(np.asarray(downpcd.normals)[:10, :])

'''
Print the normal vectors of the first 10 points
[[ 0.99552379 -0.03798043  0.08654404]
 [-0.00180642 -0.97317626  0.23005372]
 [-0.03311035  0.95990356 -0.27836821]
 [-0.18007638 -0.98233851 -0.05082867]
 [ 0.03201738 -0.92865206  0.36956763]
 [-0.09411325  0.9584897  -0.26914715]
 [-0.00804695  0.97716482 -0.21233029]
 [-0.95046739 -0.20590633  0.2328397 ]
 [ 0.58566868  0.7923609   0.17075245]
 [-0.19273423 -0.87191173  0.45013714]]
'''

3.3 點(diǎn)云裁剪

Open3D的點(diǎn)云裁剪需要通過read_selection_polygon_volume讀取多邊形選擇區(qū)域的json文件,接著通過.crop_point_cloud()方法過濾出點(diǎn)。

print("Load a polygon volume and use it to crop the original point cloud")
demo_crop_data = o3d.data.DemoCropPointCloud()
pcd = o3d.io.read_point_cloud(demo_crop_data.point_cloud_path)
vol = o3d.visualization.read_selection_polygon_volume(demo_crop_data.cropped_json_path)
chair = vol.crop_point_cloud(pcd)
o3d.visualization.draw_geometries([chair],
                                  zoom=0.7,
                                  front=[0.5439, -0.2333, -0.8060],
                                  lookat=[2.4615, 2.1331, 1.338],
                                  up=[-0.1781, -0.9708, 0.1608])

Open3D點(diǎn)云處理
Open3D點(diǎn)云處理

3.4 繪制點(diǎn)云

paint_uniform_color可以將點(diǎn)云顏色繪制成同一的色彩。注意顏色是在[0,1]之間的float類型。

print("Paint chair")
chair.paint_uniform_color([1, 0.706, 0])
o3d.visualization.draw_geometries([chair],
                                  zoom=0.7,
                                  front=[0.5439, -0.2333, -0.8060],
                                  lookat=[2.4615, 2.1331, 1.338],
                                  up=[-0.1781, -0.9708, 0.1608])

Open3D點(diǎn)云處理

3.5 選擇點(diǎn)云

在Open3D中,可以通過點(diǎn)云索引來進(jìn)行篩選。select_by_index也可以通過修改invert方法進(jìn)行反向選取。

inner=pcd1.select_by_index([i for i in range(len(pcd1.points)) if i%2==0])
outer=pcd1.select_by_index([i for i in range(10)],invert=True)
o3d.visualization.draw_geometries([pcd1])
o3d.visualization.draw_geometries([inner])
o3d.visualization.draw_geometries([outer])

Open3D點(diǎn)云處理
Open3D點(diǎn)云處理
Open3D點(diǎn)云處理


四、點(diǎn)云數(shù)據(jù)計(jì)算

4.1 點(diǎn)云距離

Open3D提供了compute_point_cloud_distance方法,能夠計(jì)算源點(diǎn)云到目標(biāo)點(diǎn)云的最近距離,該方法也能用于計(jì)算兩點(diǎn)云之間的切角距離。

demo_crop_data = o3d.data.DemoCropPointCloud()
pcd = o3d.io.read_point_cloud(demo_crop_data.point_cloud_path)
vol = o3d.visualization.read_selection_polygon_volume(demo_crop_data.cropped_json_path)
chair = vol.crop_point_cloud(pcd)

# 從原始圖像到裁剪圖像中最近點(diǎn)的距離
dists=pcd.compute_point_cloud_distance(chair)
dists=np.asarray(dists)
ind=np.where(dists>0.1)[0]
pcd_without_chair = pcd.select_by_index(ind)
o3d.visualization.draw_geometries([pcd_without_chair],
                                  zoom=0.3412,
                                  front=[0.4257, -0.2125, -0.8795],
                                  lookat=[2.6172, 2.0475, 1.532],
                                  up=[-0.0694, -0.9768, 0.2024])

Open3D點(diǎn)云處理

4.2 邊界體積

與其幾何類型相似,PointCloud也具有邊界體積。

aabb = chair.get_axis_aligned_bounding_box()
aabb.color = (1, 0, 0)
obb = chair.get_oriented_bounding_box()
obb.color = (0, 1, 0)
o3d.visualization.draw_geometries([chair, aabb, obb],
                                  zoom=0.7,
                                  front=[0.5439, -0.2333, -0.8060],
                                  lookat=[2.4615, 2.1331, 1.338],
                                  up=[-0.1781, -0.9708, 0.1608])

Open3D點(diǎn)云處理

4.3 凸包計(jì)算

點(diǎn)云凸包是包含所有點(diǎn)的最小凸集,在Open3D中,可采用compute_convex_hull計(jì)算。

bunny = o3d.data.BunnyMesh()
mesh = o3d.io.read_triangle_mesh(bunny.path)
mesh.compute_vertex_normals()

pcl = mesh.sample_points_poisson_disk(number_of_points=2000)
hull, _ = pcl.compute_convex_hull()
hull_ls = o3d.geometry.LineSet.create_from_triangle_mesh(hull)
hull_ls.paint_uniform_color((1, 0, 0))
o3d.visualization.draw_geometries([pcl, hull_ls])

Open3D點(diǎn)云處理

4.4 DBSCAN聚類

DBSCAN是Ester在1996年提出的一種聚類算法,Open3D中也提供了該算法的APIpc.cluster_dbscan(eps,min_points,print_progress),eps定義了簇的半徑距離,而min_points定義形成簇的最小點(diǎn)數(shù)量。返回是一個(gè)標(biāo)簽對(duì)象,若值為-1則表示噪聲。

import matplotlib.pyplot as plt
ply_point_cloud = o3d.data.PLYPointCloud()
pcd = o3d.io.read_point_cloud(ply_point_cloud.path)

with o3d.utility.VerbosityContextManager(
        o3d.utility.VerbosityLevel.Debug) as cm:
    labels = np.array(
        pcd.cluster_dbscan(eps=0.02, min_points=10, print_progress=True))

max_label = labels.max()
print(f"point cloud has {max_label + 1} clusters")
colors = plt.get_cmap("tab20")(labels / (max_label if max_label > 0 else 1))
colors[labels < 0] = 0
pcd.colors = o3d.utility.Vector3dVector(colors[:, :3])
o3d.visualization.draw_geometries([pcd],
                                  zoom=0.455,
                                  front=[-0.4999, -0.1659, -0.8499],
                                  lookat=[2.1813, 2.0619, 2.0999],
                                  up=[0.1204, -0.9852, 0.1

Open3D點(diǎn)云處理

4.5 平面分割

Open3D支持使用RANSAC方法從點(diǎn)云中分割幾何基元(geometric primitives)。通過segment_plane方法,可以找到點(diǎn)云中的最大支持平面(the plane with the largest support)。該方法提供了三個(gè)參數(shù):

  • distance_threshold:定義了一個(gè)點(diǎn)可被視為內(nèi)嵌點(diǎn)的估計(jì)平面的最大距離
  • ransac_n:定義用來估計(jì)平面的隨機(jī)抽樣點(diǎn)數(shù)量
  • num_iterations:定義了隨機(jī)平面抽樣和驗(yàn)證的頻率

Open3D點(diǎn)云處理

4.6 消隱點(diǎn)

當(dāng)我們從給定視角渲染點(diǎn)云時(shí),由于前方?jīng)]有遮擋,可能會(huì)有背面的點(diǎn)滲入到前景中。Katz提出了一種消隱算法(Hidden point removal),可以從給定的視圖中近似地獲得點(diǎn)云的可見性,而無需表面重建或正常的估計(jì)。

print("Convert mesh to a point cloud and estimate dimensions")
armadillo = o3d.data.ArmadilloMesh()
mesh = o3d.io.read_triangle_mesh(armadillo.path)
mesh.compute_vertex_normals()

pcd = mesh.sample_points_poisson_disk(5000)
diameter = np.linalg.norm(
    np.asarray(pcd.get_max_bound()) - np.asarray(pcd.get_min_bound()))
o3d.visualization.draw_geometries([pcd])

Open3D點(diǎn)云處理

print("Define parameters used for hidden_point_removal")
camera = [0, 0, diameter]
radius = diameter * 100

print("Get all points that are visible from given view point")
_, pt_map = pcd.hidden_point_removal(camera, radius)

print("Visualize result")
pcd = pcd.select_by_index(pt_map)
o3d.visualization.draw_geometries([pcd])

Open3D點(diǎn)云處理文章來源地址http://www.zghlxwxcb.cn/news/detail-416027.html

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

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

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

相關(guān)文章

  • 基于Open3D的點(diǎn)云處理16-特征點(diǎn)匹配

    基于Open3D的點(diǎn)云處理16-特征點(diǎn)匹配

    將點(diǎn)云數(shù)據(jù)統(tǒng)一到一個(gè)世界坐標(biāo)系的過程稱之為點(diǎn)云配準(zhǔn)或者點(diǎn)云拼接。(registration/align) 點(diǎn)云配準(zhǔn)的過程其實(shí)就是找到同名點(diǎn)對(duì);即找到在點(diǎn)云中處在真實(shí)世界同一位置的點(diǎn)。 常見的點(diǎn)云配準(zhǔn)算法: ICP、Color ICP、Trimed-ICP 算法流程: 選點(diǎn): 確定參與到配準(zhǔn)過程中的點(diǎn)集。 匹

    2024年02月10日
    瀏覽(39)
  • 【點(diǎn)云處理教程】00計(jì)算機(jī)視覺的Open3D簡介

    【點(diǎn)云處理教程】00計(jì)算機(jī)視覺的Open3D簡介

    ????????Open3D 是一個(gè)開源庫,使開發(fā)人員能夠處理 3D 數(shù)據(jù)。它提供了一組用于 3D 數(shù)據(jù)處理、可視化和機(jī)器學(xué)習(xí)任務(wù)的工具。該庫支持各種數(shù)據(jù)格式,例如 .ply、.obj、.stl 和 .xyz,并允許用戶創(chuàng)建自定義數(shù)據(jù)結(jié)構(gòu)并在程序中訪問它們。 Open3D 廣泛應(yīng)用于機(jī)器人、增強(qiáng)現(xiàn)實(shí)和自

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

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

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

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

    2024年02月13日
    瀏覽(50)
  • open3d點(diǎn)云平移

    open3d點(diǎn)云平移

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

    2024年01月22日
    瀏覽(41)
  • Open3d點(diǎn)云對(duì)象詳解

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

    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日
    瀏覽(52)
  • Open3D常用點(diǎn)云濾波

    在點(diǎn)云處理中,過密的點(diǎn)云需要下采樣,離群點(diǎn)和噪聲點(diǎn)需要去除,通過濾波的方法,可以抽稀點(diǎn)云,把離群點(diǎn)去除,以便進(jìn)行下一步處理 open3d中,很多濾波器已經(jīng)被封裝成了對(duì)應(yīng)的方法(源碼是C++) 直通濾波過濾指定維度(x,y,z)內(nèi),指定值域外的點(diǎn) 下采樣 首先根據(jù)輸入

    2024年02月06日
    瀏覽(27)
  • Open3D 詳解:點(diǎn)云裁剪實(shí)戰(zhàn)

    Open3D 詳解:點(diǎn)云裁剪實(shí)戰(zhàn) 在進(jìn)行點(diǎn)云處理時(shí),經(jīng)常需要對(duì)點(diǎn)云進(jìn)行裁剪操作,以去除無用的噪點(diǎn)或僅保留感興趣區(qū)域內(nèi)的點(diǎn)云。Open3D 是一個(gè)廣泛應(yīng)用于三維數(shù)據(jù)處理的開源庫,提供了簡單易用的點(diǎn)云裁剪方法。 以下是一個(gè)基于 Open3D 的點(diǎn)云裁剪實(shí)戰(zhàn)例程。首先,我們導(dǎo)入需

    2024年02月06日
    瀏覽(28)

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

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請(qǐng)作者喝杯咖啡吧~博客贊助

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

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包