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

open3d點(diǎn)云配準(zhǔn)函數(shù)registration_icp

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

open3d快速上手

基本原理

ICP, 即Iterative Closest Point, 迭代點(diǎn)算法。

ICP算法有多種形式,其中最簡(jiǎn)單的思路就是比較點(diǎn)與點(diǎn)之間的距離,對(duì)于點(diǎn)云 P = { p i } , Q = { q i } P=\{p_i\}, Q=\{q_i\} P={pi?},Q={qi?}而言,如果二者是同一目標(biāo),通過(guò)旋轉(zhuǎn)、平移等操作可以實(shí)現(xiàn)重合的話,那么只需要固定 Q Q Q而不斷地旋轉(zhuǎn)或平移 P P P,最終二者一定能最完美地重合。

設(shè)旋轉(zhuǎn) P P P的矩陣為 R R R,平移矩陣為 t t t,在完美匹配的情況下,必有 q i = R p i + t q_i = Rp_i + t qi?=Rpi?+t。

又因三維點(diǎn)云不具備柵格特征,故而很難保證 q i q_i qi? p i p_i pi?是同一點(diǎn),所以要使得目標(biāo)函數(shù)最小化

arg?min ? R , t 1 2 ∑ i = 1 n ∥ q i ? R p i ? t ∥ 2 \argmin_{R,t}\frac{1}{2}\sum^n_{i=1}\Vert q_i-Rp_i-t\Vert^2 R,targmin?21?i=1n?qi??Rpi??t2

1992年Chen和Medioni對(duì)此方案進(jìn)行了改進(jìn),提出了點(diǎn)對(duì)面的預(yù)估方法,其目標(biāo)函數(shù)為

arg?min ? R , t 1 2 ∑ i = 1 n [ ( q i ? R p i ) ? n p ] 2 \argmin_{R,t}\frac{1}{2}\sum^n_{i=1}[(q_i-Rp_i)\cdot n_p]^2 R,targmin?21?i=1n?[(qi??Rpi?)?np?]2

其中 n p n_p np?是點(diǎn) p p p的法線,這種方案顯然效率更高。

open3d調(diào)用

open3d中實(shí)現(xiàn)了ICP算法,參數(shù)如下

registration_icp(source, target, max_correspondence_distance, init, estimation_method, criteria)

source為點(diǎn)云 P P Ptarget為目標(biāo)點(diǎn)云 Q Q Q,max_correspondence_distance為匹配點(diǎn)在未匹配時(shí)的最大距離,init為初始變化矩陣,默認(rèn)為單位矩陣;criteria為精度。

estimation_method可以理解為上面提到的兩種方案,下面選擇點(diǎn)對(duì)點(diǎn)ICP方法進(jìn)行計(jì)算

import numpy as np
import open3d as o3d

pipreg = o3d.pipelines.registration

pcd = o3d.data.DemoICPPointClouds()
src = o3d.io.read_point_cloud(pcd.paths[0])
tar = o3d.io.read_point_cloud(pcd.paths[1])
th = 0.02
trans_init = np.array([
    [0.862, 0.011, -0.507, 0.5], [-0.139, 0.967, -0.215, 0.7],
    [0.487, 0.255, 0.835, -1.4], [0.0, 0.0, 0.0, 1.0]])

reg = pipreg.registration_icp(
    src, tar, th, trans_init,
    pipreg.TransformationEstimationPointToPoint())

print(reg.transformation)
''' 變換矩陣
[[ 0.83924644  0.01006041 -0.54390867  0.64639961]
 [-0.15102344  0.96521988 -0.21491604  0.75166079]
 [ 0.52191123  0.2616952   0.81146378 -1.50303533]
 [ 0.          0.          0.          1.        ]]
'''
print(reg)

print(reg)的返回信息如下,表示點(diǎn)云配準(zhǔn)的擬合程度

RegistrationResult with fitness=3.724495e-01, inlier_rmse=7.760179e-03, and correspondence_set size of 74056 Access transformation to get result.

繪圖

為了對(duì)比配準(zhǔn)前后的區(qū)別,對(duì)srctar放在圖中對(duì)比

import copy
srcDraw = copy.deepcopy(src)
tarDraw = copy.deepcopy(tar)
srcDraw.paint_uniform_color([1, 1, 0])
tarDraw.paint_uniform_color([0, 1, 1])
srcDraw.transform(tf)
o3d.visualization.draw_geometries([srcDraw, tarDraw])

此為原圖,可以看到兩組點(diǎn)云完全是錯(cuò)位的

open3d點(diǎn)云配準(zhǔn)函數(shù)registration_icp

srcDraw = copy.deepcopy(src)
tarDraw.paint_uniform_color([0, 1, 1])
srcDraw.transform(reg.transformation)
o3d.visualization.draw_geometries([srcDraw, tarDraw])

得到結(jié)果如下,可見(jiàn)兩組不同顏色的點(diǎn)云已經(jīng)幾乎重合到了一起

open3d點(diǎn)云配準(zhǔn)函數(shù)registration_icp文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-418386.html

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

本文來(lái)自互聯(lián)網(wǎng)用戶投稿,該文觀點(diǎn)僅代表作者本人,不代表本站立場(chǎng)。本站僅提供信息存儲(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)云平移

    open3d點(diǎn)云平移

    功能簡(jiǎ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)可以通過(guò)pcd.get_center()得到。 代碼

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

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

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

    2023年04月19日
    瀏覽(53)
  • Open3D點(diǎn)云數(shù)據(jù)處理(一):VSCode配置python,并安裝open3d教程

    Open3D點(diǎn)云數(shù)據(jù)處理(一):VSCode配置python,并安裝open3d教程

    專欄地址:https://blog.csdn.net/weixin_46098577/category_11392993.html 在很久很久以前,我寫(xiě)過(guò)這么一篇博客,講的是open3d點(diǎn)云處理的基本方法。?? 當(dāng)時(shí)是 PyCharm + Anaconda + python3.8 + open3d 0.13 已經(jīng)是2023年了,現(xiàn)在有了全新版本。目前python由當(dāng)年的3.8更新到了3.11版本,open3d也從0.13來(lái)到了

    2024年02月07日
    瀏覽(37)
  • open3d操作.ply文件(點(diǎn)云)

    open3d操作.ply文件(點(diǎn)云)

    讀取.ply文件

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

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

    2024年02月06日
    瀏覽(29)
  • 點(diǎn)云可視化 open3D

    點(diǎn)云可視化 open3D

    禁止轉(zhuǎn)載 Python點(diǎn)云數(shù)據(jù)處理(六)Open3d補(bǔ)充:點(diǎn)云基本處理 - 知乎 https://zhuanlan.zhihu.com/p/353971365?utm_id=0 open3d繪制點(diǎn)云1–單幀點(diǎn)云 - 知乎 https://zhuanlan.zhihu.com/p/591249741 (168條消息) open3D 的使用,pcd可視化,3D bbox可視化,web_visualizer使用等。_CV礦工的博客-CSDN博客 https://blog.csdn.ne

    2024年02月09日
    瀏覽(37)
  • open3d-點(diǎn)云讀寫(xiě)和顯示

    open3d-點(diǎn)云讀寫(xiě)和顯示

    目錄 一,點(diǎn)云讀取 二,點(diǎn)云寫(xiě)入 二,點(diǎn)云顯示 三、 open3d支持如下點(diǎn)云文件類型 ?四、代碼及結(jié)果示例 參數(shù): filename (str): 點(diǎn)云文件路徑 format (str, optional, default=\\\'auto\\\'): 輸入文件格式filehe的路徑。?如果未指定或設(shè)置為“auto”,則從文件擴(kuò)展名推斷格式? remove_nan_points (bool,

    2024年02月04日
    瀏覽(25)
  • Open3D常用點(diǎn)云濾波

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

    2024年02月06日
    瀏覽(27)
  • PyQt open3d 加載 顯示點(diǎn)云

    PyQt open3d 加載 顯示點(diǎn)云

    PyQt加載 顯示點(diǎn)云,已經(jīng)有三種方式,使用 open3d; 使用 vtk; 使用 pcl; 下面是使用 open3d: ?

    2024年02月11日
    瀏覽(30)
  • Open3D 點(diǎn)云裁剪(Python版本)

    基于用戶給定的多邊形區(qū)域,來(lái)提取區(qū)域內(nèi)所有的點(diǎn)云數(shù)據(jù),這個(gè)多邊形Open3D會(huì)通過(guò)一個(gè)json文件來(lái)進(jìn)行指定。 CropPointCloud.py

    2024年02月13日
    瀏覽(45)

覺(jué)得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

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

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

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包