Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
libo24 committed Feb 3, 2015
2 parents 9274d90 + b7d646d commit 5bc058e
Show file tree
Hide file tree
Showing 239 changed files with 7,301 additions and 1,541 deletions.
8 changes: 7 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ if(POLICY CMP0048)
cmake_policy(SET CMP0048 OLD) # do not use VERSION option in project() command
endif()

if(POLICY CMP0054)
cmake_policy(SET CMP0054 OLD) # Silent warnings about quoted variables
endif()

set(CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "possible configurations" FORCE)

# In case the user does not setup CMAKE_BUILD_TYPE, assume it's RelWithDebInfo
Expand Down Expand Up @@ -370,7 +374,9 @@ if(WITH_VTK AND NOT ANDROID)
if (PCL_SHARED_LIBS OR
(NOT (PCL_SHARED_LIBS) AND NOT (VTK_BUILD_SHARED_LIBS)))
set(VTK_FOUND TRUE)
find_package (QVTK)
find_library (QVTK_LIBRARY_DEBUG NAMES "@QVTK_LIBRARY_DEBUG_NAME@")
find_library (QVTK_LIBRARY_RELEASE NAMES "@QVTK_LIBRARY_RELEASE_NAME@")
set(QVTK_LIBRARY optimized ${QVTK_LIBRARY_RELEASE} debug ${QVTK_LIBRARY_DEBUG})
if (${VTK_MAJOR_VERSION} VERSION_LESS "6.0")
message(STATUS "VTK found (include: ${VTK_INCLUDE_DIRS}, lib: ${VTK_LIBRARY_DIRS})")
link_directories(${VTK_LIBRARY_DIRS})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ namespace pcl
void
estimate (PointInTPtr & in, PointInTPtr & processed,
std::vector<pcl::PointCloud<FeatureT>, Eigen::aligned_allocator<pcl::PointCloud<FeatureT> > > & signatures,
std::vector<Eigen::Vector3f> & centroids)
std::vector<Eigen::Vector3f, Eigen::aligned_allocator<Eigen::Vector3f> > & centroids)
{

if (!feature_estimator_)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ namespace pcl
void
estimate (PointInTPtr & in, PointInTPtr & processed,
typename pcl::PointCloud<FeatureT>::CloudVectorType & signatures,
std::vector<Eigen::Vector3f> & centroids)
std::vector<Eigen::Vector3f, Eigen::aligned_allocator<Eigen::Vector3f> > & centroids)
{

if (!normal_estimator_)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ namespace pcl
void
estimate (PointInTPtr & in, PointInTPtr & processed,
typename pcl::PointCloud<FeatureT>::CloudVectorType & signatures,
std::vector<Eigen::Vector3f> & centroids)
std::vector<Eigen::Vector3f, Eigen::aligned_allocator<Eigen::Vector3f> > & centroids)
{

typedef typename pcl::ESFEstimation<PointInT, FeatureT> ESFEstimation;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ namespace pcl
public:
virtual void
estimate (PointInTPtr & in, PointInTPtr & processed, std::vector<pcl::PointCloud<FeatureT>, Eigen::aligned_allocator<
pcl::PointCloud<FeatureT> > > & signatures, std::vector<Eigen::Vector3f> & centroids)=0;
pcl::PointCloud<FeatureT> > > & signatures, std::vector<Eigen::Vector3f, Eigen::aligned_allocator<Eigen::Vector3f> > & centroids)=0;

virtual bool computedNormals() = 0;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ namespace pcl

virtual void
estimate (PointInTPtr & in, PointInTPtr & processed, typename pcl::PointCloud<FeatureT>::CloudVectorType & signatures,
std::vector<Eigen::Vector3f> & centroids)
std::vector<Eigen::Vector3f, Eigen::aligned_allocator<Eigen::Vector3f> > & centroids)
{

valid_roll_transforms_.clear ();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ namespace pcl
void
estimate (PointInTPtr & in, PointInTPtr & processed,
typename pcl::PointCloud<FeatureT>::CloudVectorType & signatures,
std::vector<Eigen::Vector3f> & centroids)
std::vector<Eigen::Vector3f, Eigen::aligned_allocator<Eigen::Vector3f> > & centroids)
{

if (!normal_estimator_)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ namespace pcl
}

void
assembleModelFromViewsAndPoses(ModelT & model, std::vector<Eigen::Matrix4f> & poses) {
assembleModelFromViewsAndPoses(ModelT & model, std::vector<Eigen::Matrix4f, Eigen::aligned_allocator<Eigen::Matrix4f> > & poses) {
for(size_t i=0; i < model.views_->size(); i++) {
Eigen::Matrix4f inv = poses[i];
typename pcl::PointCloud<PointInT>::Ptr global_cloud(new pcl::PointCloud<PointInT>);
Expand Down Expand Up @@ -159,7 +159,7 @@ namespace pcl
}
}

std::vector<Eigen::Matrix4f> poses_to_assemble_;
std::vector<Eigen::Matrix4f, Eigen::aligned_allocator<Eigen::Matrix4f> > poses_to_assemble_;

for (size_t i = 0; i < view_filenames.size (); i++)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ template<template<class > class Distance, typename PointInT, typename FeatureT>
PointInTPtr in (new pcl::PointCloud<PointInT>);

typename pcl::PointCloud<FeatureT>::CloudVectorType signatures;
std::vector < Eigen::Vector3f > centroids;
std::vector < Eigen::Vector3f, Eigen::aligned_allocator<Eigen::Vector3f> > centroids;

if (indices_.size ())
{
Expand Down Expand Up @@ -187,7 +187,7 @@ template<template<class > class Distance, typename PointInT, typename FeatureT>
PointInTPtr processed (new pcl::PointCloud<PointInT>);
//pro view, compute signatures
typename pcl::PointCloud<FeatureT>::CloudVectorType signatures;
std::vector < Eigen::Vector3f > centroids;
std::vector < Eigen::Vector3f, Eigen::aligned_allocator<Eigen::Vector3f> > centroids;
estimator_->estimate (models->at (i).views_->at (v), processed, signatures, centroids);

//source_->makeModelPersistent (models->at (i), training_dir_, descr_name_, static_cast<int> (v));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ template<template<class > class Distance, typename PointInT, typename FeatureT>
PointInTPtr in (new pcl::PointCloud<PointInT>);

std::vector<pcl::PointCloud<FeatureT>, Eigen::aligned_allocator<pcl::PointCloud<FeatureT> > > signatures;
std::vector < Eigen::Vector3f > centroids;
std::vector < Eigen::Vector3f, Eigen::aligned_allocator<Eigen::Vector3f> > centroids;

if (indices_.size ())
pcl::copyPointCloud (*input_, indices_, *in);
Expand Down Expand Up @@ -442,7 +442,7 @@ template<template<class > class Distance, typename PointInT, typename FeatureT>

//pro view, compute signatures and CRH
std::vector<pcl::PointCloud<FeatureT>, Eigen::aligned_allocator<pcl::PointCloud<FeatureT> > > signatures;
std::vector < Eigen::Vector3f > centroids;
std::vector < Eigen::Vector3f, Eigen::aligned_allocator<Eigen::Vector3f> > centroids;
crh_estimator_->estimate (view, processed, signatures, centroids);

std::string path = source_->getModelDescriptorDir (models->at (i), training_dir_, descr_name_);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ template<template<class > class Distance, typename PointInT, typename FeatureT>
PointInTPtr in (new pcl::PointCloud<PointInT>);

std::vector<pcl::PointCloud<FeatureT>, Eigen::aligned_allocator<pcl::PointCloud<FeatureT> > > signatures;
std::vector < Eigen::Vector3f > centroids;
std::vector < Eigen::Vector3f, Eigen::aligned_allocator<Eigen::Vector3f> > centroids;

if (indices_.size ())
pcl::copyPointCloud (*input_, indices_, *in);
Expand Down Expand Up @@ -669,7 +669,7 @@ template<template<class > class Distance, typename PointInT, typename FeatureT>

//pro view, compute signatures
std::vector<pcl::PointCloud<FeatureT>, Eigen::aligned_allocator<pcl::PointCloud<FeatureT> > > signatures;
std::vector < Eigen::Vector3f > centroids;
std::vector < Eigen::Vector3f, Eigen::aligned_allocator<Eigen::Vector3f> > centroids;
micvfh_estimator_->estimate (view, processed, signatures, centroids);

std::vector<bool> valid_trans;
Expand Down
61 changes: 22 additions & 39 deletions apps/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,6 @@ set(SUBSYS_NAME apps)
set(SUBSYS_DESC "Application examples/samples that show how PCL works")
set(SUBSYS_DEPS common geometry io filters sample_consensus segmentation visualization kdtree features surface octree registration keypoints tracking search recognition ml stereo)

# Find VTK
if(NOT VTK_FOUND)
set(DEFAULT FALSE)
set(REASON "VTK was not found.")
else(NOT VTK_FOUND)
set(DEFAULT TRUE)
set(REASON)
include("${VTK_USE_FILE}")
endif(NOT VTK_FOUND)

# OpenNI found?
if(NOT OPENNI_FOUND)
set(DEFAULT FALSE)
set(REASON "OpenNI was not found.")
else(NOT OPENNI_FOUND)
set(DEFAULT TRUE)
set(REASON)
endif(NOT OPENNI_FOUND)

set(DEFAULT FALSE)
PCL_SUBSYS_OPTION(build "${SUBSYS_NAME}" "${SUBSYS_DESC}" ${DEFAULT} "${REASON}")
PCL_SUBSYS_DEPEND(build "${SUBSYS_NAME}" DEPS ${SUBSYS_DEPS} OPT_DEPS openni vtk)
Expand All @@ -47,6 +28,12 @@ if(build)
endif(LIBUSB_1_FOUND)

if (VTK_FOUND)

include("${VTK_USE_FILE}")

set(incs "include/pcl/${SUBSYS_NAME}/render_views_tesselated_sphere.h")
set(srcs "src/render_views_tesselated_sphere.cpp")

PCL_ADD_EXECUTABLE(pcl_ppf_object_recognition "${SUBSYS_NAME}" src/ppf_object_recognition.cpp)
target_link_libraries(pcl_ppf_object_recognition pcl_common pcl_io pcl_filters pcl_features pcl_registration pcl_visualization pcl_sample_consensus pcl_segmentation)

Expand Down Expand Up @@ -180,11 +167,6 @@ if(build)

endif ()

set(incs
include/pcl/${SUBSYS_NAME}/render_views_tesselated_sphere.h
include/pcl/${SUBSYS_NAME}/timer.h)
set(srcs src/render_views_tesselated_sphere.cpp)

if (QHULL_FOUND)
PCL_ADD_EXECUTABLE_OPT_BUNDLE(pcl_openni_3d_convex_hull "${SUBSYS_NAME}" src/openni_3d_convex_hull.cpp)
target_link_libraries(pcl_openni_3d_convex_hull pcl_common pcl_io pcl_filters pcl_visualization pcl_segmentation pcl_sample_consensus pcl_features pcl_surface)
Expand All @@ -195,10 +177,6 @@ if(build)
PCL_ADD_EXECUTABLE_OPT_BUNDLE(pcl_openni_tracking "${SUBSYS_NAME}" src/openni_tracking.cpp)
target_link_libraries(pcl_openni_tracking pcl_common pcl_io pcl_surface pcl_visualization pcl_filters pcl_features pcl_segmentation pcl_tracking pcl_search)

set(incs "include/pcl/${SUBSYS_NAME}/dominant_plane_segmentation.h" ${incs})
set(impl_incs "include/pcl/${SUBSYS_NAME}/impl/dominant_plane_segmentation.hpp")
set(srcs src/dominant_plane_segmentation.cpp ${srcs})

PCL_ADD_EXECUTABLE_OPT_BUNDLE(pcl_openni_planar_convex_hull "${SUBSYS_NAME}" src/openni_planar_convex_hull.cpp)
target_link_libraries(pcl_openni_planar_convex_hull pcl_common pcl_io pcl_filters pcl_visualization pcl_segmentation pcl_sample_consensus pcl_surface)

Expand All @@ -207,17 +185,6 @@ if(build)

endif() # QHULL_FOUND

# Install include files
PCL_ADD_INCLUDES("${SUBSYS_NAME}" "${SUBSYS_NAME}" ${incs})
PCL_ADD_INCLUDES("${SUBSYS_NAME}" "${SUBSYS_NAME}/impl" ${impl_incs})

set(LIB_NAME "pcl_${SUBSYS_NAME}")
PCL_ADD_LIBRARY("${LIB_NAME}" "${SUBSYS_NAME}" ${srcs} ${impl_incs} ${incs})
target_link_libraries("${LIB_NAME}" pcl_common pcl_io pcl_filters pcl_visualization pcl_segmentation pcl_surface pcl_features pcl_sample_consensus pcl_search)

PCL_MAKE_PKGCONFIG("${LIB_NAME}" "${SUBSYS_NAME}" "${SUBSYS_DESC}" "" "" "" "" "")


PCL_ADD_EXECUTABLE_OPT_BUNDLE(pcl_ni_agast "${SUBSYS_NAME}" src/ni_agast.cpp)
target_link_libraries(pcl_ni_agast pcl_common pcl_io pcl_filters pcl_visualization pcl_segmentation pcl_sample_consensus pcl_features pcl_keypoints pcl_surface pcl_search)

Expand Down Expand Up @@ -252,4 +219,20 @@ if(build)
add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/${subdir}")
endforeach(subdir)

set(incs
"include/pcl/${SUBSYS_NAME}/dominant_plane_segmentation.h"
"include/pcl/${SUBSYS_NAME}/timer.h"
${incs}
)
set(impl_incs "include/pcl/${SUBSYS_NAME}/impl/dominant_plane_segmentation.hpp")
set(srcs "src/dominant_plane_segmentation.cpp" ${srcs})

set(LIB_NAME "pcl_${SUBSYS_NAME}")
PCL_ADD_LIBRARY("${LIB_NAME}" "${SUBSYS_NAME}" ${srcs} ${impl_incs} ${incs})
target_link_libraries("${LIB_NAME}" pcl_common pcl_io pcl_filters pcl_visualization pcl_segmentation pcl_surface pcl_features pcl_sample_consensus pcl_search)
PCL_MAKE_PKGCONFIG("${LIB_NAME}" "${SUBSYS_NAME}" "${SUBSYS_DESC}" "" "" "" "" "")
# Install include files
PCL_ADD_INCLUDES("${SUBSYS_NAME}" "${SUBSYS_NAME}" ${incs})
PCL_ADD_INCLUDES("${SUBSYS_NAME}" "${SUBSYS_NAME}/impl" ${impl_incs})

endif(build)
1 change: 0 additions & 1 deletion apps/cloud_composer/src/cloud_view.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ pcl::cloud_composer::CloudView::rowsInserted (const QModelIndex& parent, int sta
{
QStandardItem* new_item = parent_item->child(row);
CloudComposerItem* item = dynamic_cast<CloudComposerItem*> (new_item);
item = dynamic_cast<CloudComposerItem*> (new_item);
if (item)
item->paintView (vis_);

Expand Down
1 change: 0 additions & 1 deletion apps/cloud_composer/src/cloud_viewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ pcl::cloud_composer::CloudViewer::addNewProject (ProjectModel* new_model)
void
pcl::cloud_composer::CloudViewer::modelChanged (int index)
{
CloudView* view = static_cast<CloudView*> (this->widget (index)); view = view;
emit newModelSelected (getModel ());
}

2 changes: 1 addition & 1 deletion apps/include/pcl/apps/impl/dominant_plane_segmentation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@
*
*/

#ifndef Q_MOC_RUN
#pragma once
#include <boost/thread/thread.hpp>
#ifndef Q_MOC_RUN
#include <boost/date_time/posix_time/posix_time.hpp>
#endif

Expand Down
2 changes: 2 additions & 0 deletions apps/include/pcl/apps/manual_registration.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@
#include <QTimer>

// Boost
#ifndef Q_MOC_RUN
#include <boost/thread/thread.hpp>
#endif

// PCL
#include <pcl/console/print.h>
Expand Down
8 changes: 4 additions & 4 deletions apps/modeler/src/scene_tree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ pcl::modeler::SceneTree::dropEvent(QDropEvent * event)
std::set<RenderWindowItem*> previous_parents;
for (QList<CloudMeshItem*>::iterator selected_cloud_meshes_it = selected_cloud_meshes.begin();
selected_cloud_meshes_it != selected_cloud_meshes.end();
selected_cloud_meshes_it ++)
++ selected_cloud_meshes_it)
{
CloudMeshItem* cloud_mesh_item = *selected_cloud_meshes_it;
RenderWindowItem* render_window_item = dynamic_cast<RenderWindowItem*>(cloud_mesh_item->parent());
Expand All @@ -493,7 +493,7 @@ pcl::modeler::SceneTree::dropEvent(QDropEvent * event)
std::vector<CloudMeshItem*> cloud_mesh_items;
for (QList<CloudMeshItem*>::iterator selected_cloud_meshes_it = selected_cloud_meshes.begin();
selected_cloud_meshes_it != selected_cloud_meshes.end();
selected_cloud_meshes_it ++)
++ selected_cloud_meshes_it)
{
CloudMeshItem* cloud_mesh_item = *selected_cloud_meshes_it;
if (dynamic_cast<RenderWindowItem*>(cloud_mesh_item->parent()) == NULL)
Expand All @@ -515,7 +515,7 @@ pcl::modeler::SceneTree::dropEvent(QDropEvent * event)

for (std::set<RenderWindowItem*>::iterator previous_parents_it = previous_parents.begin();
previous_parents_it != previous_parents.end();
previous_parents_it ++)
++ previous_parents_it)
{
(*previous_parents_it)->getRenderWindow()->updateAxes();
(*previous_parents_it)->getRenderWindow()->render();
Expand All @@ -535,7 +535,7 @@ pcl::modeler::SceneTree::dropMimeData(QTreeWidgetItem * parent, int, const QMime

for (QList<CloudMeshItem*>::iterator selected_cloud_meshes_it = selected_cloud_meshes.begin();
selected_cloud_meshes_it != selected_cloud_meshes.end();
selected_cloud_meshes_it ++)
++ selected_cloud_meshes_it)
{
CloudMeshItem* cloud_mesh_item_copy = new CloudMeshItem(render_window_item, *(*selected_cloud_meshes_it));
render_window_item->addChild(cloud_mesh_item_copy);
Expand Down
11 changes: 2 additions & 9 deletions apps/point_cloud_editor/src/cloud.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -254,15 +254,8 @@ Cloud::drawWithHighlightColor () const
void
Cloud::draw (bool disable_highlight) const
{
SelectionPtr selection_ptr;
try
{
selection_ptr = selection_wk_ptr_.lock();
}
catch (boost::bad_weak_ptr)
{
selection_ptr.reset();
}
SelectionPtr selection_ptr = selection_wk_ptr_.lock();

glPushAttrib(GL_CURRENT_BIT | GL_POINT_BIT | GL_COLOR_BUFFER_BIT);
{
glPointSize(point_size_);
Expand Down
2 changes: 1 addition & 1 deletion apps/src/ni_agast.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ class AGASTDemo
keypoints3d.height = keypoints->height;
keypoints3d.is_dense = true;

int j = 0;
size_t j = 0;
for (size_t i = 0; i < keypoints->size (); ++i)
{
const PointT &pt = (*cloud)(static_cast<long unsigned int> (keypoints->points[i].u),
Expand Down
2 changes: 1 addition & 1 deletion apps/src/ni_brisk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ class BRISKDemo
keypoints3d.height = keypoints->height;
keypoints3d.is_dense = true;

int j = 0;
size_t j = 0;
for (size_t i = 0; i < keypoints->size (); ++i)
{
PointT pt = bilinearInterpolation (cloud, keypoints->points[i].x, keypoints->points[i].y);
Expand Down
4 changes: 2 additions & 2 deletions apps/src/openni_change_viewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class OpenNIChangeViewer
filtered_cloud.reset (new pcl::PointCloud<pcl::PointXYZRGBA> (*cloud));
filtered_cloud->points.reserve(newPointIdxVector->size());

for (std::vector<int>::iterator it = newPointIdxVector->begin (); it != newPointIdxVector->end (); it++)
for (std::vector<int>::iterator it = newPointIdxVector->begin (); it != newPointIdxVector->end (); ++it)
filtered_cloud->points[*it].rgba = 255<<16;

if (!viewer.wasStopped())
Expand All @@ -101,7 +101,7 @@ class OpenNIChangeViewer

filtered_cloud->points.reserve(newPointIdxVector->size());

for (std::vector<int>::iterator it = newPointIdxVector->begin (); it != newPointIdxVector->end (); it++)
for (std::vector<int>::iterator it = newPointIdxVector->begin (); it != newPointIdxVector->end (); ++it)
filtered_cloud->points.push_back(cloud->points[*it]);


Expand Down
2 changes: 1 addition & 1 deletion apps/src/openni_tracking.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ class OpenNISegmentTracking
}

void addNormalToCloud (const CloudConstPtr &cloud,
const pcl::PointCloud<pcl::Normal>::ConstPtr &normals,
const pcl::PointCloud<pcl::Normal>::ConstPtr &,
RefCloud &result)
{
result.width = cloud->width;
Expand Down
Loading

0 comments on commit 5bc058e

Please sign in to comment.