2017-07-25 98 views
-1

我有一個ToF(飛行時間)攝像頭。從相機的深度數據可在XYZ格式通過使用一定C API,如下面給出的獲得 -通過將自定義C API與通用點雲查看器集成來查看3D點雲

xCoordinate = ((int16_t *)xCoordinates)[x + y*xRes]; 
yCoordinate = ((int16_t *)yCoordinates)[x + y*xRes]; 
zCoordinate = ((int16_t *)zCoordinates)[x + y*xRes]; 

我可以啓動一個無限while循環,以保持從前方的場景獲得上述座標的相機。 然而,對於可視化的目的爲三維點雲,我想用在http://pointclouds.org/documentation/tutorials/pcl_visualizer.php

我的問題提供的API,因此有以下幾種:

  1. 我能夠通過使用預編譯的二進制文件成功安裝PCL這裏提供 - http://unanancyowen.com/en/pcl18/。具體來說,我使用VS 2015(當然是32位)。因此,我安裝了PCL-1.8.1rc2-AllInOne-msvc2017-win32二進制應用程序。使用cmake我能夠成功獲得一個.sln項目,用於cloudviewer的演示pcl應用程序(如此處所示 - http://pointclouds.org/documentation/tutorials/cloud_viewer.php#cloud-viewer)。但是我得到的編譯使用VS 2017的錯誤出現在項目的.sln一些鏈接錯誤是:

cloud_viewer.obj:錯誤LNK2019:無法解析的外部符號「市民:布爾__thiscall PCL ::可視化: :PCLVisualizer :: removeShape(類 std :: basic_string,類 std :: allocator> const &,int)「 (?removeShape @ PCLVisualizer @ visualization @ pcl @@ QAE_NABV?$ basic_string @ DU?$ char_traits @ D @ std @@ V $ $ allocator @ D @ 2 @@ std @@ H @ Z)在函數「void __cdecl viewerPsycho(class pcl :: visualization :: PCLVisualizer &)」

cloud_viewer.obj:錯誤LNK2019:解析外部符號 「公共:無效__thiscall PCL ::可視化:: PCLVisualizer :: setBackgroundColor(雙常量 &,雙常量&,雙常量&,INT)」 (? setBackgroundColor @ PCLVisualizer @可視化@ PCL @@ QAEXABN00H @ Z) 函數引用 「無效__cdecl viewerOneOff(類 PCL ::可視化:: PCLVisualizer &)」 (?viewerOneOff @@ YAXAAVPCLVisualizer @可視化@ PCL @@@ Z)

cloud_viewer.obj:錯誤LNK2019:無法解析的外部符號「公共:布爾__thiscall PCL ::可視化:: PCLVisualizer :: addText(類 的std :: basic_string的,類 的std ::分配器>常量&,INT,INT,類 的std :: basic_string的,類 STD: :分配器>常量&,INT)」

cloud_viewer.obj:錯誤LNK2019:解析外部符號 「私人:無效__thiscall PCL ::可視化:: PCLVisualizer :: addActorToRenderer(類 vtkSmartPointer常量&,INT)」 (?addActorToRenderer @ PCLVisualizer @ visualization @ pcl @@ AAEXABV?$ vtkSmartPointer @ VvtkProp @@@@ H @ Z) 在函數中引用「public:bool __thiscall pcl :: visualization :: PCLVisualizer :: addSphere(pcl :: PointXYZ const , )「

cloud_viewer。obj:error LNK2019:無法解析的外部符號「public:__thiscall pcl :: visualization :: CloudViewer :: CloudViewer(class std :: basic_string,class std :: allocator> const &)」 (?? 0CloudViewer @ visualization @ pcl @@ QAE @ ABV?$ basic_string @ DU?$ char_traits @ D @ std @@ V?$ allocator @ D @ 2 @@ std @@@ Z) 在函數_main中引用 cloud_viewer.obj:錯誤LNK2019:無法解析的外部符號 「公共:__thiscall PCL ::可視化:: CloudViewer ::〜CloudViewer(無效)」 (?? 1CloudViewer @ @可視PCL @@ @ QAE XZ)在功能 引用_main

cloud_viewer.obj:錯誤LNK2019:無法解析的外部符號「public:void __ thiscall PCL ::可視化:: CloudViewer :: showCloud(類 的boost :: shared_ptr的 常量>常量&,一流的std :: basic_string的,一流的std ::分配器>常量&)」 (?showCloud @ CloudViewer @可視化@ PCL @@ QAEXABV?$ @的shared_ptr $$ CBV?$ @點雲@ UPointXYZRGBA PCL @@@ PCL @@@提振@@ ABV?$ @的basic_string杜?$ @ char_traits @ d @@性病V'$ @分配器@ d 2 @@ STD @@@ Z) 在函數引用_main

cloud_viewer.obj:錯誤LNK2019:解析外部符號 「公共:布爾__thiscall PCL ::可視化:: CloudViewer :: wasStopped(INT)」 ( ?wasStopped @ CloudViewer @ visualization @ pcl @@ QAE_NH @ Z)在中引用函數_main

  1. 我只有XYZ數據沒有任何RGB值。我必須使用PCL的哪些功能?
  2. 我的main.cpp文件必須如何? 是否與此處提到的抓取器主類似 - http://pointclouds.org/documentation/tutorials/openni_grabber.php

  3. 我知道我必須構建自己的VisualStudio項目。哪些來自pcl庫的頭文件和cpp文件我需要複製並放入我的項目中使用?

  4. 除了使用選定的PCL文件(標題和cpp)之外,還必須安裝哪些附加工具/軟件?

+0

3年前,我和老年人PCL做了類似的事情。請查看示例代碼:https://bitbucket.org/Logrus/cv-project/src/dbcb87218a0976bb4312403ee34ec53a87e37540?at=master –

+0

感謝您的參考代碼。看起來你是在Linux平臺上構建你的應用程序的。我正在Windows平臺上構建它。因此,我想知道是否需要安裝PCL,還是隻能從pointclouds.org的網站獲取預編譯的dll庫和頭文件? –

+0

您可以獲得預建版本。不幸的是,我現在沒有PCL的Windows系統,所以我不確定它有多難。但它應該可以通過遵循官方指示來管理。有人將關於如何在Windows上使用PCL + CMake的視頻指令放在一起:https://www.youtube.com/watch?v = jcBVzAnrH70希望它們足夠有用。 –

回答

1
  1. 貌似你不鏈接PCL可視化庫文件,可能別人。在項目屬性>鏈接器>輸入>附加依賴項中執行此操作。應該在項目屬性> VC++目錄>庫目錄中指定PCL lib目錄的路徑。同時,應在項目屬性> VC++目錄>包含目錄中指定到PCL包含目錄的路徑。
  2. PCL函數和類型以點類型爲模板。因此,您將使用pcl::PointXYZ作爲所有功能的點類型。
  3. 不會。您的更類似於CloudViewer tutorial中的簡單雲可視化示例。
  4. 您不會將PCL .h和.cpp文件複製到您的解決方案中。您的#include保留在其安裝位置的PCL標題,以及您鏈接到PCL lib文件(參見上面的1)。
  5. 無。如果PCL bin /目錄不在您的$ PATH中,請將PCL .dll放在您的.exe的旁邊。

確保您將發行版庫與發佈版本和調試庫與調試版本匹配。確保您正在爲Win32或x64構建,具體取決於您安裝的預安裝二進制文件。