├── README.md ├── src ├── CMakeLists.txt └── pcl_ed_visualizer.cpp └── .gitignore /README.md: -------------------------------------------------------------------------------- 1 | # README 2 | 3 | This is a project about a edge-detection application with PointCloud Library. 4 | -------------------------------------------------------------------------------- /src/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.6 FATAL_ERROR) 2 | 3 | project(pclEDVisualizer) 4 | 5 | find_package(PCL 1.8 REQUIRED) 6 | find_package(OpenCV REQUIRED) 7 | 8 | include_directories(${PCL_INCLUDE_DIRS}) 9 | link_directories(${PCL_LIBRARY_DIRS}) 10 | add_definitions(${PCL_DEFINITIONS}) 11 | 12 | add_executable (pclEDVisualizer pcl_ed_visualizer.cpp) 13 | target_link_libraries (pclEDVisualizer ${PCL_LIBRARIES} ${OpenCV_LIBS}) 14 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files 2 | *.slo 3 | *.lo 4 | *.o 5 | *.obj 6 | 7 | # Precompiled Headers 8 | *.gch 9 | *.pch 10 | 11 | # Compiled Dynamic libraries 12 | *.so 13 | *.dylib 14 | *.dll 15 | 16 | # Fortran module files 17 | *.mod 18 | 19 | # Compiled Static libraries 20 | *.lai 21 | *.la 22 | *.a 23 | *.lib 24 | 25 | # Executables 26 | *.exe 27 | *.out 28 | *.app 29 | 30 | # Directories 31 | build/ 32 | .metadata/ 33 | RemoteSystemsTempFiles/ 34 | -------------------------------------------------------------------------------- /src/pcl_ed_visualizer.cpp: -------------------------------------------------------------------------------- 1 | /* \author Geoffrey Biggs */ 2 | /* \author Ariel Hernandez */ 3 | 4 | 5 | #include 6 | 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | 26 | 27 | using namespace std; 28 | using namespace pcl; 29 | using namespace pcl::io; 30 | using namespace pcl::console; 31 | using namespace cv; 32 | 33 | #define OK 0 34 | #define FAILED -1 35 | 36 | 37 | // -------------- 38 | // -----Help----- 39 | // -------------- 40 | void 41 | printUsage (const char* progName) 42 | { 43 | cout << "\n\nUsage: "< simpleVisualisation (PointCloud::ConstPtr cloud) 60 | { 61 | boost::shared_ptr viewer (new visualization::PCLVisualizer ("3D Viewer")); 62 | viewer->setBackgroundColor (0, 0, 0); 63 | viewer->addPointCloud (cloud, "PointCloud sample"); 64 | viewer->setPointCloudRenderingProperties (visualization::PCL_VISUALIZER_POINT_SIZE, 1, "PointCloud sample"); 65 | viewer->addCoordinateSystem (1.0); 66 | viewer->initCameraParameters (); 67 | return (viewer); 68 | } 69 | 70 | 71 | // -------------------------------------------- 72 | // -----Compute EdgeDetection------------------ 73 | // -------------------------------------------- 74 | boost::shared_ptr computeEdgeDetection (PointCloud::ConstPtr cloud, float th_dd, int max_search) 75 | { 76 | boost::shared_ptr viewer (new visualization::PCLVisualizer ("3D Viewer")); 77 | 78 | PointCloud::Ptr normal (new PointCloud); 79 | IntegralImageNormalEstimation ne; 80 | ne.setNormalEstimationMethod (ne.COVARIANCE_MATRIX); 81 | ne.setNormalSmoothingSize (10.0f); 82 | ne.setBorderPolicy (ne.BORDER_POLICY_MIRROR); 83 | ne.setInputCloud (cloud); 84 | ne.compute (*normal); 85 | 86 | OrganizedEdgeFromNormals oed; 87 | //OrganizedEdgeFromRGBNormals oed; 88 | oed.setInputNormals (normal); 89 | oed.setInputCloud (cloud); 90 | oed.setDepthDisconThreshold (th_dd); 91 | oed.setMaxSearchNeighbors (max_search); 92 | oed.setEdgeType (oed.EDGELABEL_NAN_BOUNDARY | oed.EDGELABEL_OCCLUDING | oed.EDGELABEL_OCCLUDED | oed.EDGELABEL_HIGH_CURVATURE | oed.EDGELABEL_RGB_CANNY); 93 | PointCloud