Ubuntu系統下讀取點雲,並顯示到螢幕中

2021-10-06 03:43:10 字數 1355 閱讀 4356

讀取點雲的源**:

#include 

#include

#include

int main(int argc,char** ar**)

std::cout<<

"loaded "

height ///< the size of points

<<

" data points from test_pcd.pcd with the following fields: "

);++i)

return(0)

;}

cmakelists.txt檔案如下

cmake_minimum_required(version 2.8 fatal_error)

project(pcd_read)

find_package(pcl 1.2 required)

include_directories($)

link_directories($)

add_definitions($)

add_executable(pcd_read pcd_read.cpp)

target_link_libraries(pcd_read $

)

然後將這兩個檔案放到乙個資料夾中,並與這兩個檔案處於同一目錄下建立build資料夾,最後編譯,執行,並顯示;

在windows下很簡單,在ubuntu系統下是這樣實現的:

mkdir build

cd build

cmake..

make

./pcd_read

最後記得將test_pcd.pcd放到build目錄下,否則讀取不成功

最後讀取結果如下

# frederic @ frederic-inspiron-3558 in ~/downloads/pcljiaocheng/pcl_abstract/第三章/1 reading pcd/source/build [17:06:01] 

$ ./pcd_read

loaded 5 data points from test_pcd.pcd with the following fields:

1.28125 577.094 197.938

828.125 599.031 491.375

358.688 917.438 842.562

764.5 178.281 879.531

727.531 525.844 311.281

讀取點雲資料並顯示

在進行完雙目視覺的圖象採集後,就會進行立體匹配,進而得到一張深度圖。利用rgb彩色和depth深度圖,結合相機的內參,可以將rgb d圖象轉換出點雲資料。點雲資料的讀取用下面這幾行 實現。轉換點雲程式和點雲資料也會一起在別的筆記裡傳上來。用到了open3d庫,採用了兩種方法,一種一行 就可以實現,一...

Matlab讀取點雲資料 顯示

求matlab讀取三維點雲資料的程式。clear a importdata data.txt ix,iy size a x a 1 y a 1 y a 2 z a 3 plot3 x,y,z,grid on gallery 函式是乙個測試矩陣生成函式。當需要對某些演算法進行測試的時,利用galler...

PCL點雲的基本讀取和顯示

廢話不多說,直接上 這是最基本的讀取與顯示,皆是利用pcl庫 include 標準輸入輸出流 include pcl的pcd格式檔案的輸入輸出標頭檔案 include pcl對各種格式的點的支援標頭檔案 include int main int argc,char argv std cout loa...