├── .gitignore ├── .gitlab-ci.yml ├── 3rdparty ├── CMakeLists.txt ├── EDT │ ├── CMakeLists.txt │ ├── distance_field.h │ ├── propagation_distance_field.cpp │ ├── propagation_distance_field.h │ └── voxel_grid.h ├── SiftGPU │ ├── .gitignore │ └── CMakeLists.txt ├── ceres │ ├── .gitignore │ ├── CMakeLists.txt │ └── fix_eigen_vector.patch ├── gtest │ └── CMakeLists.txt ├── libsvm │ ├── .gitignore │ └── CMakeLists.txt ├── metslib │ ├── CMakeLists.txt │ ├── abstract-search.hh │ ├── local-search.hh │ ├── mets.hh │ ├── metslib_config.hh │ ├── model.hh │ ├── observer.hh │ ├── simulated-annealing.hh │ ├── tabu-search.hh │ └── termination-criteria.hh ├── on_nurbs │ ├── CMakeLists.txt │ ├── closing_boundary.cpp │ ├── closing_boundary.h │ ├── fitting_curve_2d.cpp │ ├── fitting_curve_2d.h │ ├── fitting_curve_2d_apdm.cpp │ ├── fitting_curve_2d_apdm.h │ ├── fitting_curve_2d_asdm.cpp │ ├── fitting_curve_2d_asdm.h │ ├── fitting_curve_2d_atdm.cpp │ ├── fitting_curve_2d_atdm.h │ ├── fitting_curve_2d_pdm.cpp │ ├── fitting_curve_2d_pdm.h │ ├── fitting_curve_2d_sdm.cpp │ ├── fitting_curve_2d_sdm.h │ ├── fitting_curve_2d_tdm.cpp │ ├── fitting_curve_2d_tdm.h │ ├── fitting_curve_pdm.cpp │ ├── fitting_curve_pdm.h │ ├── fitting_cylinder_pdm.cpp │ ├── fitting_cylinder_pdm.h │ ├── fitting_sphere_pdm.cpp │ ├── fitting_sphere_pdm.h │ ├── fitting_surface_im.cpp │ ├── fitting_surface_im.h │ ├── fitting_surface_pdm.cpp │ ├── fitting_surface_pdm.h │ ├── fitting_surface_tdm.cpp │ ├── fitting_surface_tdm.h │ ├── global_optimization_pdm.cpp │ ├── global_optimization_pdm.h │ ├── global_optimization_tdm.cpp │ ├── global_optimization_tdm.h │ ├── nurbs_data.h │ ├── nurbs_solve.h │ ├── nurbs_solve_eigen.cpp │ ├── nurbs_solve_umfpack.cpp │ ├── nurbs_tools.cpp │ ├── nurbs_tools.h │ ├── on_nurbs.cmake │ ├── sequential_fitter.cpp │ ├── sequential_fitter.h │ ├── sparse_mat.cpp │ ├── sparse_mat.h │ ├── triangulation.cpp │ └── triangulation.h ├── opennurbs │ ├── CMakeLists.txt │ ├── adler32.c │ ├── compress.c │ ├── crc32.c │ ├── crc32.h │ ├── deflate.c │ ├── deflate.h │ ├── examples_linking_pragmas.h │ ├── faq.txt │ ├── infback.c │ ├── inffast.c │ ├── inffast.h │ ├── inffixed.h │ ├── inflate.c │ ├── inflate.h │ ├── inftrees.c │ ├── inftrees.h │ ├── openNURBS.cmake │ ├── opennurbs.h │ ├── opennurbs.rc │ ├── opennurbs_3dm.h │ ├── opennurbs_3dm_attributes.cpp │ ├── opennurbs_3dm_attributes.h │ ├── opennurbs_3dm_properties.cpp │ ├── opennurbs_3dm_properties.h │ ├── opennurbs_3dm_settings.cpp │ ├── opennurbs_3dm_settings.h │ ├── opennurbs_annotation.cpp │ ├── opennurbs_annotation.h │ ├── opennurbs_annotation2.cpp │ ├── opennurbs_annotation2.h │ ├── opennurbs_arc.cpp │ ├── opennurbs_arc.h │ ├── opennurbs_arccurve.cpp │ ├── opennurbs_arccurve.h │ ├── opennurbs_archive.cpp │ ├── opennurbs_archive.h │ ├── opennurbs_array.cpp │ ├── opennurbs_array.h │ ├── opennurbs_array_defs.h │ ├── opennurbs_base32.cpp │ ├── opennurbs_base32.h │ ├── opennurbs_base64.cpp │ ├── opennurbs_base64.h │ ├── opennurbs_beam.cpp │ ├── opennurbs_beam.h │ ├── opennurbs_bezier.cpp │ ├── opennurbs_bezier.h │ ├── opennurbs_beziervolume.cpp │ ├── opennurbs_bitmap.cpp │ ├── opennurbs_bitmap.h │ ├── opennurbs_bounding_box.cpp │ ├── opennurbs_bounding_box.h │ ├── opennurbs_box.cpp │ ├── opennurbs_box.h │ ├── opennurbs_brep.cpp │ ├── opennurbs_brep.h │ ├── opennurbs_brep_extrude.cpp │ ├── opennurbs_brep_io.cpp │ ├── opennurbs_brep_isvalid.cpp │ ├── opennurbs_brep_region.cpp │ ├── opennurbs_brep_tools.cpp │ ├── opennurbs_brep_v2valid.cpp │ ├── opennurbs_circle.cpp │ ├── opennurbs_circle.h │ ├── opennurbs_color.cpp │ ├── opennurbs_color.h │ ├── opennurbs_compress.cpp │ ├── opennurbs_compress.h │ ├── opennurbs_cone.cpp │ ├── opennurbs_cone.h │ ├── opennurbs_crc.cpp │ ├── opennurbs_crc.h │ ├── opennurbs_curve.cpp │ ├── opennurbs_curve.h │ ├── opennurbs_curveonsurface.cpp │ ├── opennurbs_curveonsurface.h │ ├── opennurbs_curveproxy.cpp │ ├── opennurbs_curveproxy.h │ ├── opennurbs_cylinder.cpp │ ├── opennurbs_cylinder.h │ ├── opennurbs_defines.cpp │ ├── opennurbs_defines.h │ ├── opennurbs_detail.cpp │ ├── opennurbs_detail.h │ ├── opennurbs_dimstyle.cpp │ ├── opennurbs_dimstyle.h │ ├── opennurbs_dll.cpp │ ├── opennurbs_dll_resource.h │ ├── opennurbs_ellipse.cpp │ ├── opennurbs_ellipse.h │ ├── opennurbs_embedded_file.cpp │ ├── opennurbs_error.cpp │ ├── opennurbs_error.h │ ├── opennurbs_error_message.cpp │ ├── opennurbs_evaluate_nurbs.cpp │ ├── opennurbs_evaluate_nurbs.h │ ├── opennurbs_extensions.cpp │ ├── opennurbs_extensions.h │ ├── opennurbs_font.cpp │ ├── opennurbs_font.h │ ├── opennurbs_fpoint.h │ ├── opennurbs_fsp.cpp │ ├── opennurbs_fsp.h │ ├── opennurbs_fsp_defs.h │ ├── opennurbs_geometry.cpp │ ├── opennurbs_geometry.h │ ├── opennurbs_gl.cpp │ ├── opennurbs_gl.h │ ├── opennurbs_group.cpp │ ├── opennurbs_group.h │ ├── opennurbs_hatch.cpp │ ├── opennurbs_hatch.h │ ├── opennurbs_hsort_template.h │ ├── opennurbs_instance.cpp │ ├── opennurbs_instance.h │ ├── opennurbs_intersect.cpp │ ├── opennurbs_intersect.h │ ├── opennurbs_knot.cpp │ ├── opennurbs_knot.h │ ├── opennurbs_layer.cpp │ ├── opennurbs_layer.h │ ├── opennurbs_light.cpp │ ├── opennurbs_light.h │ ├── opennurbs_line.cpp │ ├── opennurbs_line.h │ ├── opennurbs_linecurve.cpp │ ├── opennurbs_linecurve.h │ ├── opennurbs_linestyle.h │ ├── opennurbs_linetype.cpp │ ├── opennurbs_linetype.h │ ├── opennurbs_lookup.cpp │ ├── opennurbs_lookup.h │ ├── opennurbs_mapchan.h │ ├── opennurbs_material.cpp │ ├── opennurbs_material.h │ ├── opennurbs_math.cpp │ ├── opennurbs_math.h │ ├── opennurbs_matrix.cpp │ ├── opennurbs_matrix.h │ ├── opennurbs_memory.c │ ├── opennurbs_memory.h │ ├── opennurbs_memory_util.c │ ├── opennurbs_mesh.cpp │ ├── opennurbs_mesh.h │ ├── opennurbs_mesh_ngon.cpp │ ├── opennurbs_mesh_tools.cpp │ ├── opennurbs_morph.cpp │ ├── opennurbs_nurbscurve.cpp │ ├── opennurbs_nurbscurve.h │ ├── opennurbs_nurbssurface.cpp │ ├── opennurbs_nurbssurface.h │ ├── opennurbs_nurbsvolume.cpp │ ├── opennurbs_object.cpp │ ├── opennurbs_object.h │ ├── opennurbs_object_history.cpp │ ├── opennurbs_object_history.h │ ├── opennurbs_objref.cpp │ ├── opennurbs_objref.h │ ├── opennurbs_offsetsurface.cpp │ ├── opennurbs_offsetsurface.h │ ├── opennurbs_optimize.cpp │ ├── opennurbs_optimize.h │ ├── opennurbs_plane.cpp │ ├── opennurbs_plane.h │ ├── opennurbs_planesurface.cpp │ ├── opennurbs_planesurface.h │ ├── opennurbs_pluginlist.cpp │ ├── opennurbs_pluginlist.h │ ├── opennurbs_point.cpp │ ├── opennurbs_point.h │ ├── opennurbs_pointcloud.cpp │ ├── opennurbs_pointcloud.h │ ├── opennurbs_pointgeometry.cpp │ ├── opennurbs_pointgeometry.h │ ├── opennurbs_pointgrid.cpp │ ├── opennurbs_pointgrid.h │ ├── opennurbs_polycurve.cpp │ ├── opennurbs_polycurve.h │ ├── opennurbs_polyedgecurve.cpp │ ├── opennurbs_polyedgecurve.h │ ├── opennurbs_polyline.cpp │ ├── opennurbs_polyline.h │ ├── opennurbs_polylinecurve.cpp │ ├── opennurbs_polylinecurve.h │ ├── opennurbs_precompiledheader.cpp │ ├── opennurbs_qsort_template.h │ ├── opennurbs_rand.cpp │ ├── opennurbs_rand.h │ ├── opennurbs_rendering.h │ ├── opennurbs_revsurface.cpp │ ├── opennurbs_revsurface.h │ ├── opennurbs_rtree.cpp │ ├── opennurbs_rtree.h │ ├── opennurbs_sort.cpp │ ├── opennurbs_sphere.cpp │ ├── opennurbs_sphere.h │ ├── opennurbs_string.cpp │ ├── opennurbs_string.h │ ├── opennurbs_sum.cpp │ ├── opennurbs_sumsurface.cpp │ ├── opennurbs_sumsurface.h │ ├── opennurbs_surface.cpp │ ├── opennurbs_surface.h │ ├── opennurbs_surfaceproxy.cpp │ ├── opennurbs_surfaceproxy.h │ ├── opennurbs_system.h │ ├── opennurbs_textlog.cpp │ ├── opennurbs_textlog.h │ ├── opennurbs_texture.h │ ├── opennurbs_texture_mapping.h │ ├── opennurbs_torus.cpp │ ├── opennurbs_torus.h │ ├── opennurbs_unicode.cpp │ ├── opennurbs_unicode.h │ ├── opennurbs_userdata.cpp │ ├── opennurbs_userdata.h │ ├── opennurbs_uuid.cpp │ ├── opennurbs_uuid.h │ ├── opennurbs_version.h │ ├── opennurbs_viewport.cpp │ ├── opennurbs_viewport.h │ ├── opennurbs_workspace.cpp │ ├── opennurbs_workspace.h │ ├── opennurbs_wstring.cpp │ ├── opennurbs_xform.cpp │ ├── opennurbs_xform.h │ ├── opennurbs_zlib.cpp │ ├── opennurbs_zlib.h │ ├── opennurbs_zlib_memory.cpp │ ├── opennurbs_zlib_readme.txt │ ├── readme.txt │ ├── trees.c │ ├── trees.h │ ├── uncompr.c │ ├── zconf.h │ ├── zlib.h │ ├── zutil.c │ └── zutil.h └── pcl_1_8 │ ├── CMakeLists.txt │ ├── conditional_euclidean_clustering.cpp │ ├── convolution_2d.cpp │ ├── organized_edge_detection.cpp │ ├── pcl_1_8 │ ├── 2d │ │ ├── convolution.h │ │ ├── edge.h │ │ ├── impl │ │ │ ├── convolution.hpp │ │ │ ├── edge.hpp │ │ │ └── kernel.hpp │ │ └── kernel.h │ ├── features │ │ ├── impl │ │ │ └── organized_edge_detection.hpp │ │ └── organized_edge_detection.h │ ├── keypoints │ │ ├── impl │ │ │ └── uniform_sampling.hpp │ │ └── uniform_sampling.h │ └── segmentation │ │ ├── conditional_euclidean_clustering.h │ │ └── impl │ │ └── conditional_euclidean_clustering.hpp │ └── uniform_sampling.cpp ├── AUTHORS ├── CHANGELOG.rst ├── CITATION.md ├── CMakeLists.txt ├── CONTRIBUTING.md ├── LICENSE ├── Readme.md ├── apps ├── 3D_scene_reconstruction_by_SIFT_and_MST │ ├── CMakeLists.txt │ └── main.cpp ├── AttentionSegmentation │ ├── CMakeLists.txt │ ├── createTrainingSet.cpp │ ├── scaleTrainingSet.cpp │ ├── segment.cpp │ ├── segmentAttention.cpp │ ├── segmentIncremental.cpp │ └── trainSVM.cpp ├── CMakeLists.txt ├── ConvertTransformationMatrixIntoPCDpose │ ├── CMakeLists.txt │ └── save_pose_into_pcd.cpp ├── MultiViewObjectRecognizer │ ├── CMakeLists.txt │ ├── cfg │ │ ├── camera.xml │ │ ├── esf_config.xml │ │ ├── hv_config.xml │ │ ├── shot_config.xml │ │ └── sift_config.xml │ ├── main.cpp │ ├── visualization.cpp │ └── visualization.h ├── ObjectGroundTruthAnnotator │ ├── CMakeLists.txt │ ├── GT6DOF.cpp │ ├── main_window.cpp │ ├── main_window.h │ ├── or_evaluator.cpp │ ├── or_evaluator.h │ └── or_evaluator.hpp ├── ObjectRecognizer │ ├── CMakeLists.txt │ ├── ReadMe.md │ ├── cfg │ │ ├── camera.xml │ │ ├── global_config.xml │ │ ├── hv_config.xml │ │ ├── multipipeline_config.xml │ │ ├── shot_config.xml │ │ ├── sift_config.xml │ │ └── xtion_depth_mask.png │ ├── check_hypotheses.cpp │ ├── compute_recognition_rate.cpp │ ├── compute_recognition_rate_over_occlusion.cpp │ ├── main.cpp │ └── mv_eval.cpp ├── RTMT │ ├── BundleAdjustment.cpp │ ├── BundleAdjustment.h │ ├── CMakeLists.txt │ ├── Camera.cpp │ ├── Camera.h │ ├── MultiSession.cpp │ ├── MultiSession.h │ ├── ObjectSegmentation.cpp │ ├── ObjectSegmentation.h │ ├── OcclusionClustering.cc │ ├── OcclusionClustering.hh │ ├── OctreeVoxelCentroidContainerXYZRGB.hpp │ ├── StoreTrackingModel.cpp │ ├── StoreTrackingModel.h │ ├── glviewer.cpp │ ├── glviewer.h │ ├── main.cpp │ ├── mainwindow.cpp │ ├── mainwindow.h │ ├── mainwindow.ui │ ├── params.cpp │ ├── params.h │ ├── params.ui │ ├── sensor.cpp │ └── sensor.h ├── segmentation │ ├── CMakeLists.txt │ └── labelingSlic.cpp └── semantic_segmentation │ ├── CMakeLists.txt │ ├── Readme.md │ ├── analyze3DEF.cpp │ ├── create_trainingdata.cpp │ ├── evaluate3DEF.cpp │ ├── merge3DEF.cpp │ ├── segmentation_demo.cpp │ ├── semseg_demo.cpp │ ├── train3DEF.cpp │ └── updateleafs3DEF.cpp ├── cmake ├── V4RCompilerOptions.cmake ├── V4RDetectCUDA.cmake ├── V4RDetectCXXCompiler.cmake ├── V4RDetectVTK.cmake ├── V4RExtraTargets.cmake ├── V4RFindAssimp.cmake ├── V4RFindBoost.cmake ├── V4RFindCaffe.cmake ├── V4RFindCeres.cmake ├── V4RFindEDT.cmake ├── V4RFindEigen.cmake ├── V4RFindGLM.cmake ├── V4RFindGTest.cmake ├── V4RFindGlew.cmake ├── V4RFindGlog.cmake ├── V4RFindLIBSVM.cmake ├── V4RFindLibsPerf.cmake ├── V4RFindMETSlib.cmake ├── V4RFindON_NURBS.cmake ├── V4RFindOpenCV.cmake ├── V4RFindOpenGL.cmake ├── V4RFindOpenNI2.cmake ├── V4RFindOpenNURBS.cmake ├── V4RFindPCL.cmake ├── V4RFindPCL_1_8.cmake ├── V4RFindQt.cmake ├── V4RFindSiftGPU.cmake ├── V4RFindX11.cmake ├── V4RFindXRandR.cmake ├── V4RGenConfig.cmake ├── V4RGenHeaders.cmake ├── V4RMinDepVersions.cmake ├── V4RModule.cmake ├── V4RUtils.cmake ├── V4RVersion.cmake └── templates │ ├── V4RConfig-version.cmake.in │ ├── V4RConfig.cmake.in │ ├── cmake_uninstall.cmake.in │ ├── v4r_config.h.in │ └── v4r_modules.h.in ├── data └── .gitignore ├── docs ├── Doxyfile ├── IMKRecognizer.md ├── ObjectClassification.md ├── ObjectDetection.md ├── ObjectModeling.md ├── images │ ├── object-modeling-01.jpg │ ├── object-modeling-01.png │ ├── object-modeling-02.jpg │ ├── object-modeling-03.jpg │ ├── object-modeling-04.jpg │ ├── object-modeling-05.jpg │ ├── object-modeling-06.jpg │ ├── object-modeling-07.jpg │ ├── object-modeling-08.jpg │ ├── object-modeling-09.jpg │ ├── object-recognition-01.jpg │ ├── object-texturing-01.jpg │ └── object-tracking-01.jpg └── v4r_style_guide.md ├── modules ├── CMakeLists.txt ├── apps │ ├── CMakeLists.txt │ ├── include │ │ └── v4r │ │ │ └── apps │ │ │ ├── CloudSegmenter.h │ │ │ ├── ObjectRecognizer.h │ │ │ ├── ObjectRecognizerParameter.h │ │ │ ├── compute_recognition_rate.h │ │ │ └── visualization.h │ └── src │ │ ├── CloudSegmenter.cpp │ │ ├── ObjectRecognizer.cpp │ │ ├── compute_recognition_rate.cpp │ │ └── visualization.cpp ├── attention_segmentation │ ├── CMakeLists.txt │ ├── include │ │ └── v4r │ │ │ └── attention_segmentation │ │ │ ├── AddGroundTruth.h │ │ │ ├── AmHitRatio.h │ │ │ ├── AssemblyRelations.h │ │ │ ├── AttentionExampleUtils.h │ │ │ ├── AttentionModule.h │ │ │ ├── AttentionModuleErrors.h │ │ │ ├── BaseMap.h │ │ │ ├── BoundaryRelationsBase.h │ │ │ ├── BoundaryRelationsMeanColor.h │ │ │ ├── BoundaryRelationsMeanCurvature.h │ │ │ ├── BoundaryRelationsMeanDepth.h │ │ │ ├── ClusterNormalsToPlanes.h │ │ │ ├── ColorHistogram.h │ │ │ ├── ColorMap.h │ │ │ ├── EPBase.h │ │ │ ├── EPEvaluation.h │ │ │ ├── EPUtils.h │ │ │ ├── Edge.h │ │ │ ├── Fourier.h │ │ │ ├── FrintropSaliencyMap.h │ │ │ ├── Gabor.h │ │ │ ├── Graph.h │ │ │ ├── GraphCut.h │ │ │ ├── HitRatio.h │ │ │ ├── IKNSaliencyMap.h │ │ │ ├── LocationMap.h │ │ │ ├── MSR.h │ │ │ ├── MapsCombination.h │ │ │ ├── OrientationMap.h │ │ │ ├── PCA.h │ │ │ ├── PCLCommonHeaders.h │ │ │ ├── PCLPreprocessingXYZRC.h │ │ │ ├── PCLUtils.h │ │ │ ├── PPlane.h │ │ │ ├── Relation.h │ │ │ ├── RelativeSurfaceOrientationMap.h │ │ │ ├── SVMFileCreator.h │ │ │ ├── SVMPredictorSingle.h │ │ │ ├── SVMScale.h │ │ │ ├── SVMTrainModel.h │ │ │ ├── StructuralRelations.h │ │ │ ├── SurfaceCurvatureMap.h │ │ │ ├── SurfaceHeightMap.h │ │ │ ├── SurfaceModel.h │ │ │ ├── SurfaceModeling.h │ │ │ ├── Symmetry3DMap.h │ │ │ ├── SymmetryMap.h │ │ │ ├── TJ.h │ │ │ ├── Texture.h │ │ │ ├── Vs3ArcRelations.h │ │ │ ├── WTA.h │ │ │ ├── ZAdaptiveNormals.h │ │ │ ├── algo.h │ │ │ ├── connectedComponents.h │ │ │ ├── convertions.h │ │ │ ├── cvgabor.h │ │ │ ├── debugUtils.h │ │ │ ├── disjoint-set.h │ │ │ ├── drawUtils.h │ │ │ ├── ep_segmentation.h │ │ │ ├── eputils_headers.h │ │ │ ├── fitting_surface_pdm.h │ │ │ ├── headers.h │ │ │ ├── math.h │ │ │ ├── normalization.h │ │ │ ├── nurbs_data.h │ │ │ ├── nurbs_solve.h │ │ │ ├── nurbs_tools.h │ │ │ ├── pyramidBase.h │ │ │ ├── pyramidFrintrop.h │ │ │ ├── pyramidItti.h │ │ │ ├── pyramidSimple.h │ │ │ ├── segmentEvaluation.h │ │ │ ├── segmentation.h │ │ │ ├── sequential_fitter.h │ │ │ ├── sparse_mat.h │ │ │ ├── sphereHistogram.h │ │ │ ├── svm.h │ │ │ ├── timeUtils.h │ │ │ └── utils.h │ └── src │ │ ├── AddGroundTruth.cpp │ │ ├── AmHitRatio.cpp │ │ ├── AttentionExampleUtils.cpp │ │ ├── BaseMap.cpp │ │ ├── BoundaryRelationsBase.cpp │ │ ├── BoundaryRelationsMeanColor.cpp │ │ ├── BoundaryRelationsMeanCurvature.cpp │ │ ├── BoundaryRelationsMeanDepth.cpp │ │ ├── ClusterNormalsToPlanes.cpp │ │ ├── ColorHistogram.cpp │ │ ├── ColorMap.cpp │ │ ├── EPBase.cpp │ │ ├── Fourier.cpp │ │ ├── FrintropSaliencyMap.cpp │ │ ├── Gabor.cpp │ │ ├── Graph.cpp │ │ ├── GraphCut.cpp │ │ ├── HitRatio.cpp │ │ ├── IKNSaliencyMap.cpp │ │ ├── LocationMap.cpp │ │ ├── MSR.cpp │ │ ├── MapsCombination.cpp │ │ ├── OrientationMap.cpp │ │ ├── PCA.cpp │ │ ├── PCLUtils.cpp │ │ ├── RelativeSurfaceOrientationMap.cpp │ │ ├── SVMFileCreator.cpp │ │ ├── SVMPredictorSingle.cpp │ │ ├── SVMScale.cpp │ │ ├── SVMTrainModel.cpp │ │ ├── StructuralRelations.cpp │ │ ├── SurfaceCurvatureMap.cpp │ │ ├── SurfaceHeightMap.cpp │ │ ├── SurfaceModel.cpp │ │ ├── SurfaceModeling.cpp │ │ ├── Symmetry3DMap.cpp │ │ ├── SymmetryMap.cpp │ │ ├── TJ.cpp │ │ ├── Texture.cpp │ │ ├── WTA.cpp │ │ ├── ZAdaptiveNormals.cc │ │ ├── algo.cpp │ │ ├── connectedComponents.cpp │ │ ├── convertions.cpp │ │ ├── cvgabor.cpp │ │ ├── debugUtils.cpp │ │ ├── disjoint-set.cpp │ │ ├── drawUtils.cpp │ │ ├── ep_segmenation.cpp │ │ ├── fitting_surface_pdm.cpp │ │ ├── math.cpp │ │ ├── normalization.cpp │ │ ├── pyramidBase.cpp │ │ ├── pyramidFrintrop.cpp │ │ ├── pyramidItti.cpp │ │ ├── pyramidSimple.cpp │ │ ├── segmentEvaluation.cpp │ │ ├── segmentation.cpp │ │ ├── sequential_fitter.cpp │ │ ├── sparse_mat.cpp │ │ ├── sphereHistogram.cpp.bkp │ │ ├── svm.cpp │ │ ├── timeUtils.cpp │ │ └── utils.cpp ├── camera_tracking_and_mapping │ ├── CMakeLists.txt │ ├── include │ │ └── v4r │ │ │ └── camera_tracking_and_mapping │ │ │ ├── BACostFunctions.hpp │ │ │ ├── OcclusionClustering.hh │ │ │ ├── OctreeVoxelCentroidContainerXYZRGBNormal.hpp │ │ │ ├── PoissonTriangulation.hh │ │ │ ├── Surfel.hh │ │ │ ├── TSFData.h │ │ │ ├── TSFDataIntegration.hh │ │ │ ├── TSFFrame.hh │ │ │ ├── TSFGlobalCloudFiltering.hh │ │ │ ├── TSFGlobalCloudFilteringSimple.h │ │ │ ├── TSFMapping.hh │ │ │ ├── TSFOptimizeBundle.hh │ │ │ ├── TSFPoseTrackerKLT.hh │ │ │ ├── TSFVisualSLAM.h │ │ │ └── TSFilterCloudsXYZRGB.h │ └── src │ │ ├── OcclusionClustering.cc │ │ ├── PoissonTriangulation.cc │ │ ├── TSFData.cpp │ │ ├── TSFDataIntegration.cc │ │ ├── TSFFrame.cc │ │ ├── TSFGlobalCloudFiltering.cc │ │ ├── TSFGlobalCloudFilteringSimple.cpp │ │ ├── TSFMapping.cc │ │ ├── TSFOptimizeBundle.cc │ │ ├── TSFPoseTrackerKLT.cc │ │ ├── TSFVisualSLAM.cpp │ │ └── TSFilterCloudsXYZRGB.cpp ├── change_detection │ ├── CMakeLists.txt │ ├── include │ │ └── v4r │ │ │ └── change_detection │ │ │ ├── change_detection.h │ │ │ ├── impl │ │ │ ├── miscellaneous.hpp │ │ │ └── object_history.hpp │ │ │ ├── miscellaneous.h │ │ │ ├── object_detection.h │ │ │ ├── object_history.h │ │ │ ├── occlusion_checker.h │ │ │ ├── viewport_checker.h │ │ │ └── visualizer.h │ └── src │ │ ├── change_detection.cpp │ │ ├── object_history.cpp │ │ ├── viewport_checker.cpp │ │ └── visualizer.cpp ├── common │ ├── CMakeLists.txt │ ├── include │ │ └── v4r │ │ │ └── common │ │ │ ├── Clustering.h │ │ │ ├── ClusteringRNN.h │ │ │ ├── DataContainer.h │ │ │ ├── PointTypes.h │ │ │ ├── ZAdaptiveNormals.h │ │ │ ├── binary_algorithms.h │ │ │ ├── camera.h │ │ │ ├── color_comparison.h │ │ │ ├── color_transforms.h │ │ │ ├── convertCloud.h │ │ │ ├── convertImage.h │ │ │ ├── convertNormals.h │ │ │ ├── convertPose.h │ │ │ ├── faat_3d_rec_framework_defines.h │ │ │ ├── flann.h │ │ │ ├── graph_geometric_consistency.h │ │ │ ├── histogram.h │ │ │ ├── img_utils.h │ │ │ ├── impl │ │ │ ├── DataMatrix2D.hpp │ │ │ ├── RandomNumbers.hpp │ │ │ ├── SmartPtr.hpp │ │ │ ├── Vector.hpp │ │ │ ├── convolution.hpp │ │ │ ├── eigen.hpp │ │ │ └── visibility_reasoning.hpp │ │ │ ├── miscellaneous.h │ │ │ ├── noise_models.h │ │ │ ├── normal_estimator.h │ │ │ ├── normal_estimator_integral_image.h │ │ │ ├── normal_estimator_pcl.h │ │ │ ├── normal_estimator_pre-process.h │ │ │ ├── normal_estimator_z_adpative.h │ │ │ ├── normals.h │ │ │ ├── occlusion_reasoning.h │ │ │ ├── pcl_opencv.h │ │ │ ├── pcl_serialization.h │ │ │ ├── pcl_utils.h │ │ │ ├── pcl_visualization_utils.h │ │ │ ├── plane_model.h │ │ │ ├── rgb2cielab.h │ │ │ ├── rotation.h │ │ │ ├── visibility_reasoning.h │ │ │ └── zbuffering.h │ └── src │ │ ├── ClusteringRNN.cpp │ │ ├── ZAdaptiveNormals.cpp │ │ ├── color_comparison.cpp │ │ ├── flann.cpp │ │ ├── graph_geometric_consistency.cpp │ │ ├── histogram.cpp │ │ ├── img_utils.cpp │ │ ├── kmeans.cpp │ │ ├── miscellaneous.cpp │ │ ├── noise_models.cpp │ │ ├── normal_estimator.cpp │ │ ├── normal_estimator_integral_image.cpp │ │ ├── normal_estimator_pcl.cpp │ │ ├── normal_estimator_pre-process.cpp │ │ ├── normal_estimator_z_adaptive.cpp │ │ ├── normals.cpp │ │ ├── occlusion_reasoning.cpp │ │ ├── pcl_opencv.cpp │ │ ├── pcl_utils.cpp │ │ ├── pcl_visualization_utils.cpp │ │ ├── plane_model.cpp │ │ ├── rgb2cielab.cpp │ │ ├── visibility_reasoning.cpp │ │ └── zbuffering.cpp ├── core │ ├── CMakeLists.txt │ ├── include │ │ └── v4r │ │ │ └── core │ │ │ ├── macros.h │ │ │ └── version.h │ └── src │ │ └── foobar.cpp ├── features │ ├── CMakeLists.txt │ ├── include │ │ └── v4r │ │ │ └── features │ │ │ ├── ComputeImGDescOrientations.h │ │ │ ├── ComputeImGradientDescriptors.h │ │ │ ├── FeatureDetector.h │ │ │ ├── FeatureDetectorHeaders.h │ │ │ ├── FeatureDetector_KD_CVSIFT.h │ │ │ ├── FeatureDetector_KD_FAST_IMGD.h │ │ │ ├── FeatureDetector_KD_ORB.h │ │ │ ├── FeatureDetector_KD_SIFTGPU.h │ │ │ ├── FeatureDetector_K_HARRIS.h │ │ │ ├── FeatureSelection.h │ │ │ ├── ImGDescOrientation.h │ │ │ ├── ImGradientDescriptor.h │ │ │ ├── PSiftGPU.h │ │ │ ├── all_headers.h │ │ │ ├── color_ourcvfh_estimator.h │ │ │ ├── colorshot_local_estimator.h │ │ │ ├── crh_estimator.h │ │ │ ├── cvfh_estimator.h_ignore │ │ │ ├── esf_estimator.h │ │ │ ├── global_alexnet_cnn_estimator.h │ │ │ ├── global_color_estimator.h │ │ │ ├── global_concatenated.h │ │ │ ├── global_estimator.h │ │ │ ├── global_simple_shape_estimator.h │ │ │ ├── image_local_estimator.h │ │ │ ├── impl │ │ │ └── pcl_ourcvfh.hpp │ │ │ ├── local_estimator.h │ │ │ ├── organized_color_ourcvfh_estimator.h_ignore │ │ │ ├── organized_ourcvfh.h_ignore │ │ │ ├── ourcvfh_estimator.h │ │ │ ├── pcl_ourcvfh.h │ │ │ ├── rops_local_estimator.h │ │ │ ├── shot_local_estimator.h │ │ │ ├── sift_local_estimator.h │ │ │ ├── types.h │ │ │ ├── vedaldi_sift_local_estimator.h │ │ │ └── vfh_estimator.h_ignore │ └── src │ │ ├── ComputeImGDescOrientations.cpp │ │ ├── ComputeImGradientDescriptors.cpp │ │ ├── FeatureDetector_KD_CVSIFT.cpp │ │ ├── FeatureDetector_KD_FAST_IMGD.cpp │ │ ├── FeatureDetector_KD_ORB.cpp │ │ ├── FeatureDetector_KD_SIFTGPU.cpp │ │ ├── FeatureDetector_K_HARRIS.cpp │ │ ├── FeatureSelection.cpp │ │ ├── ImGDescOrientation.cpp │ │ ├── ImGradientDescriptor.cpp │ │ ├── PSiftGPU.cpp │ │ ├── esf_estimator.cpp │ │ ├── global_alexnet_cnn_estimator.cpp │ │ ├── global_color_estimator.cpp │ │ ├── global_concatenated.cpp │ │ ├── global_simple_shape_estimator.cpp │ │ ├── ourcvfh_estimator.cpp │ │ ├── pcl_ourcvfh.cpp │ │ ├── rops_local_estimator.cpp │ │ ├── shot_local_estimator.cpp │ │ └── sift_local_estimator.cpp ├── io │ ├── CMakeLists.txt │ ├── include │ │ └── v4r │ │ │ └── io │ │ │ ├── eigen.h │ │ │ └── filesystem.h │ └── src │ │ ├── eigen.cpp │ │ └── filesystem.cpp ├── keypoints │ ├── CMakeLists.txt │ ├── include │ │ └── v4r │ │ │ └── keypoints │ │ │ ├── ArticulatedObject.h │ │ │ ├── ClusterNormalsToPlanes.h │ │ │ ├── CodebookMatcher.h │ │ │ ├── Part.h │ │ │ ├── PartMotion6D.h │ │ │ ├── PartRotation1D.h │ │ │ ├── PlaneEstimationRANSAC.h │ │ │ ├── RigidTransformationRANSAC.h │ │ │ ├── all_headers.h │ │ │ ├── harris3d_keypoint_extractor.h │ │ │ ├── impl │ │ │ ├── ArticulatedObject_serialization.hpp │ │ │ ├── Object.hpp │ │ │ ├── PoseIO.hpp │ │ │ ├── eigen_boost_serialization.hpp │ │ │ ├── invPose.hpp │ │ │ ├── opencv_serialization.hpp │ │ │ ├── pair_serialization.hpp │ │ │ ├── toString.hpp │ │ │ ├── triple.hpp │ │ │ ├── triple_serialization.hpp │ │ │ └── warpPatchHomography.hpp │ │ │ ├── io.h │ │ │ ├── iss_keypoint_extractor.h │ │ │ ├── keypoint_extractor.h │ │ │ ├── narf_keypoint_extractor.h │ │ │ ├── temporal_smoothing_filter.h │ │ │ ├── types.h │ │ │ └── uniform_sampling_extractor.h │ └── src │ │ ├── ArticulatedObject.cpp │ │ ├── ClusterNormalsToPlanes.cpp │ │ ├── CodebookMatcher.cpp │ │ ├── Object.cpp │ │ ├── Part.cpp │ │ ├── PartMotion6D.cpp │ │ ├── PartRotation1D.cpp │ │ ├── PlaneEstimationRANSAC.cpp │ │ ├── RigidTransformationRANSAC.cpp │ │ ├── harris3d_keypoint_extractor.cpp │ │ ├── io.cpp │ │ ├── iss_keypoint_extractor.cpp │ │ ├── keypoint_extractor.cpp │ │ ├── narf_keypoint_extractor.cpp │ │ ├── temporal_smoothing_filter.cpp │ │ └── uniform_sampling_extractor.cpp ├── ml │ ├── CMakeLists.txt │ ├── README │ ├── include │ │ └── v4r │ │ │ └── ml │ │ │ ├── all_headers.h │ │ │ ├── classificationdata.h │ │ │ ├── classifier.h │ │ │ ├── forest.h │ │ │ ├── ml_utils.h │ │ │ ├── nearestNeighbor.h │ │ │ ├── node.h │ │ │ ├── svmWrapper.h │ │ │ ├── tree.h │ │ │ └── types.h │ └── src │ │ ├── classificationdata.cpp │ │ ├── forest.cpp │ │ ├── ml_utils.cpp │ │ ├── nearestNeighbor.cpp │ │ ├── node.cpp │ │ ├── svmWrapper.cpp │ │ └── tree.cpp ├── object_modelling │ ├── CMakeLists.txt │ ├── include │ │ └── v4r │ │ │ └── object_modelling │ │ │ ├── incremental_object_learning.h │ │ │ └── model_view.h │ └── src │ │ ├── incremental_object_learning.cpp │ │ └── visualization.cpp ├── recognition │ ├── CMakeLists.txt │ ├── include │ │ └── v4r │ │ │ └── recognition │ │ │ ├── IMKObjectVotesClustering.h │ │ │ ├── IMKOptimizeModel.h │ │ │ ├── IMKRecognizer.h │ │ │ ├── IMKRecognizerIO.h │ │ │ ├── IMKRecognizer_serialization.hpp │ │ │ ├── IMKView.h │ │ │ ├── RansacSolvePnP.h │ │ │ ├── RansacSolvePnPdepth.h │ │ │ ├── boost_graph_visualization_extension.h__ignore │ │ │ ├── ghv_opt.h │ │ │ ├── global_recognition_pipeline.h │ │ │ ├── global_recognizer.h │ │ │ ├── hypotheses_verification.h │ │ │ ├── hypotheses_verification_param.h │ │ │ ├── hypotheses_verification_visualization.h │ │ │ ├── impl │ │ │ ├── multi_pipeline_recognizer_init.hpp │ │ │ ├── multiview_object_recognizer.hpp │ │ │ ├── multiview_object_recognizer_change_detection.hpp │ │ │ └── multiview_object_recognizer_init.hpp │ │ │ ├── local_feature_matching.h │ │ │ ├── local_rec_object_hypotheses.h │ │ │ ├── local_recognition_pipeline.h │ │ │ ├── metrics.h │ │ │ ├── model.h │ │ │ ├── multi_pipeline_recognizer.h │ │ │ ├── multiview_object_recognizer.h │ │ │ ├── multiview_object_recognizer_change_detection.h │ │ │ ├── multiview_recognizer.h │ │ │ ├── multiview_representation.h │ │ │ ├── object_hypothesis.h │ │ │ ├── recognition_pipeline.h │ │ │ ├── source.h │ │ │ └── vtk_model_sampling.h │ └── src │ │ ├── IMKObjectVotesClustering.cpp │ │ ├── IMKOptimizeModel.cpp │ │ ├── IMKRecognizer.cpp │ │ ├── IMKRecognizerIO.cpp │ │ ├── RansacSolvePnP.cpp │ │ ├── RansacSolvePnPdepth.cpp │ │ ├── ghv_opt.cpp │ │ ├── global_recognition_pipeline.cpp │ │ ├── global_recognizer.cpp │ │ ├── hypotheses_verification.cpp │ │ ├── hypotheses_verification_visualization.cpp │ │ ├── local_feature_matching.cpp │ │ ├── local_rec_object_hypotheses.cpp │ │ ├── local_recognition_pipeline.cpp │ │ ├── model.cpp │ │ ├── multi_pipeline_recognizer.cpp │ │ ├── multiview_object_recognizer.cpp │ │ ├── multiview_object_recognizer_change_detection.cpp │ │ ├── multiview_recognizer.cpp │ │ ├── multiview_representation.cpp │ │ ├── object_hypothesis.cpp │ │ ├── recognition_model_hv.cpp │ │ ├── recognition_pipeline.cpp │ │ └── source.cpp ├── reconstruction │ ├── CMakeLists.txt │ ├── include │ │ └── v4r │ │ │ └── reconstruction │ │ │ ├── KeyframeManagementRGBD2.h │ │ │ ├── KeypointPoseDetector.h │ │ │ ├── KeypointPoseDetectorRT.h │ │ │ ├── KeypointSlamRGBD2.h │ │ │ ├── LKPoseTracker.h │ │ │ ├── LKPoseTrackerRT.h │ │ │ ├── ProjBundleAdjuster.h │ │ │ ├── ProjLKPoseTrackerLM.h │ │ │ ├── ProjLKPoseTrackerR2.h │ │ │ ├── ProjLKPoseTrackerRT.h │ │ │ ├── RefinePatchLocationLK.h │ │ │ ├── RefineProjectedPointLocationLK.h │ │ │ ├── RefineProjectedPointLocationLKbase.h │ │ │ └── impl │ │ │ ├── ReprojectionError.hpp │ │ │ └── projectPointToImage.hpp │ └── src │ │ ├── KeyframeManagementRGBD2.cpp │ │ ├── KeypointPoseDetector.cpp │ │ ├── KeypointPoseDetectorRT.cpp │ │ ├── KeypointSlamRGBD2.cpp │ │ ├── LKPoseTracker.cpp │ │ ├── LKPoseTrackerRT.cpp │ │ ├── ProjBundleAdjuster.cpp │ │ ├── ProjLKPoseTrackerLM.cpp │ │ ├── ProjLKPoseTrackerR2.cpp │ │ ├── ProjLKPoseTrackerRT.cpp │ │ ├── RefinePatchLocationLK.cpp │ │ └── RefineProjectedPointLocationLK.cpp ├── registration │ ├── CMakeLists.txt │ ├── include │ │ └── v4r │ │ │ └── registration │ │ │ ├── FeatureBasedRegistration.h │ │ │ ├── MultiSessionModelling.h │ │ │ ├── MvLMIcp.h │ │ │ ├── PartialModelRegistrationBase.h │ │ │ ├── StablePlanesRegistration.h │ │ │ ├── fast_icp_with_gc.h │ │ │ ├── impl │ │ │ └── fast_icp_with_gc.hpp │ │ │ ├── metrics.h │ │ │ ├── noise_model_based_cloud_integration.h │ │ │ └── uniform_sampling.h │ └── src │ │ ├── FeatureBasedRegistration.cpp │ │ ├── MultiSessionModelling.cpp │ │ ├── MvLMIcp.cpp │ │ ├── PartialModelRegistrationBase.cpp │ │ ├── StablePlanesRegistration.cpp │ │ ├── fast_icp_with_gc.cpp │ │ ├── metrics.cpp │ │ └── noise_model_based_cloud_integration.cpp ├── rendering │ ├── CMakeLists.txt │ ├── include │ │ └── v4r │ │ │ └── rendering │ │ │ ├── depthmapRenderer.h │ │ │ └── dmRenderObject.h │ └── src │ │ ├── depthmapRenderer.cpp │ │ └── dmRenderObject.cpp ├── segmentation │ ├── CMakeLists.txt │ ├── include │ │ └── v4r │ │ │ └── segmentation │ │ │ ├── ClusterNormalsToPlanes.h │ │ │ ├── ClusterNormalsToPlanesPCL.h │ │ │ ├── SLICO.h │ │ │ ├── Slic.h │ │ │ ├── SlicRGBD.h │ │ │ ├── all_headers.h │ │ │ ├── plane_extractor.h │ │ │ ├── plane_extractor_organized_multiplane.h │ │ │ ├── plane_extractor_sac.h │ │ │ ├── plane_extractor_sac_normals.h │ │ │ ├── plane_extractor_tile.h │ │ │ ├── plane_utils.h │ │ │ ├── segmentation_utils.h │ │ │ ├── segmenter.h │ │ │ ├── segmenter_2d_connected_components.h │ │ │ ├── segmenter_euclidean.h │ │ │ ├── segmenter_organized_connected_component.h │ │ │ ├── smooth_Euclidean_segmenter.h │ │ │ └── types.h │ └── src │ │ ├── ClusterNormalsToPlanesPCL.cpp │ │ ├── SLICO.cpp │ │ ├── Slic.cpp │ │ ├── SlicRGBD.cpp │ │ ├── all_headers.cpp │ │ ├── plane_extractor_organized_multiplane.cpp │ │ ├── plane_extractor_sac.cpp │ │ ├── plane_extractor_sac_normals.cpp │ │ ├── plane_extractor_tile.cpp │ │ ├── plane_utils.cpp │ │ ├── segmentation_utils.cpp │ │ ├── segmenter_2d_connected_components.cpp │ │ ├── segmenter_euclidean.cpp │ │ ├── segmenter_organized_connected_component.cpp │ │ └── smooth_Euclidean_segmenter.cpp ├── semantic_segmentation │ ├── CMakeLists.txt │ ├── include │ │ └── v4r │ │ │ └── semantic_segmentation │ │ │ ├── entangled_data.h │ │ │ ├── entangled_definitions.h │ │ │ ├── entangled_feature_extraction.h │ │ │ ├── entangled_forest.h │ │ │ ├── entangled_node.h │ │ │ ├── entangled_split_feature.h │ │ │ ├── entangled_tree.h │ │ │ ├── impl │ │ │ └── supervoxel_segmentation.hpp │ │ │ └── supervoxel_segmentation.h │ └── src │ │ ├── entangled_data.cpp │ │ ├── entangled_feature_extraction.cpp │ │ ├── entangled_forest.cpp │ │ ├── entangled_node.cpp │ │ ├── entangled_split_feature.cpp │ │ ├── entangled_tree.cpp │ │ └── supervoxel_segmentation.cpp └── tracking │ ├── CMakeLists.txt │ ├── include │ └── v4r │ │ └── tracking │ │ ├── KeypointObjectRecognizerR2.h │ │ └── ObjectTrackerMono.h │ └── src │ ├── KeypointObjectRecognizerR2.cpp │ └── ObjectTrackerMono.cpp ├── package.xml ├── samples ├── CMakeLists.txt ├── eval │ ├── CMakeLists.txt │ ├── esf_object_classifier.cpp │ ├── incremental_object_learning.cpp │ ├── object_recognizer.cpp │ └── object_recognizer_multiview.cpp ├── examples │ ├── CMakeLists.txt │ ├── Exmpl3DSymSalMap.cpp │ ├── ExmplColorMap.cpp │ ├── ExmplFrintropSaliencyMap.cpp │ ├── ExmplHitRatio.cpp │ ├── ExmplIttiSaliencyMap.cpp │ ├── ExmplLocationMap.cpp │ ├── ExmplMSR.cpp │ ├── ExmplMapCombination.cpp │ ├── ExmplOrientationMap.cpp │ ├── ExmplSalLine.cpp │ ├── ExmplSurfCurvatureMap.cpp │ ├── ExmplSurfHeightMap.cpp │ ├── ExmplSurfOrientationMap.cpp │ ├── ExmplSymSalMap.cpp │ ├── ExmplWTA.cpp │ ├── camera_tracking_and_filtering.cpp │ ├── camera_tracking_and_mapping.cpp │ ├── classify_with_RF.cpp │ ├── classify_with_SVM_tmp.cpp │ ├── depth_map_renderer.cpp │ ├── esf_object_classifier.cpp │ ├── imkOptimizeModel.cpp │ ├── imkRecognizeObject-file.cpp │ ├── incremental_object_learning.cpp │ ├── keypoint_extraction.cpp │ ├── noise_model_based_cloud_integration.cpp │ ├── object_recognizer_multiview.cpp │ ├── object_tracker_mono.cpp │ ├── segment_pcd.cpp │ └── temporalFiltering.cpp └── tools │ ├── CMakeLists.txt │ ├── convertOldModelDatabaseToNew.cpp │ ├── create_annotated_images_from_recognition_gt_data.cpp │ ├── create_classification_db_from_ply_files.cpp │ ├── pcd2png.cpp │ ├── pcd_ground_truth_labelling.cpp │ ├── save_pose_into_pcd.cpp │ ├── view_all_point_clouds_in_folder.cpp │ └── visualize_hypothesis.cpp ├── scripts ├── NYU_Depth_Dataset │ ├── Readme.md │ ├── v1 │ │ ├── mat2pcl │ │ │ ├── license.txt │ │ │ ├── loadpcd.m │ │ │ ├── lspcd.m │ │ │ ├── lzfd.m │ │ │ ├── pclviewer.m │ │ │ └── savepcd.m │ │ ├── prepare_v1_dataset.m │ │ ├── toolbox │ │ │ ├── .svn │ │ │ │ ├── all-wcprops │ │ │ │ ├── entries │ │ │ │ └── text-base │ │ │ │ │ ├── README.svn-base │ │ │ │ │ ├── compile.m.svn-base │ │ │ │ │ ├── confusion_matrix.m.svn-base │ │ │ │ │ ├── demo_get_train_test_split.m.svn-base │ │ │ │ │ ├── demo_synched_projected_frames.m.svn-base │ │ │ │ │ ├── eval_seg.m.svn-base │ │ │ │ │ ├── get_accel_data.cpp.svn-base │ │ │ │ │ ├── get_accel_data.m.svn-base │ │ │ │ │ ├── get_projected_depth.m.svn-base │ │ │ │ │ ├── get_projection_mask.m.svn-base │ │ │ │ │ ├── get_scene_counts.m.svn-base │ │ │ │ │ ├── get_scene_counts_as_perc.m.svn-base │ │ │ │ │ ├── get_scene_type_from_scene.m.svn-base │ │ │ │ │ ├── get_synched_frames.m.svn-base │ │ │ │ │ ├── get_train_test_split.m.svn-base │ │ │ │ │ ├── test_eval_seg.m.svn-base │ │ │ │ │ ├── test_get_scene_counts_as_perc.m.svn-base │ │ │ │ │ └── test_get_scene_type_from_scene.m.svn-base │ │ │ ├── README │ │ │ ├── compile.m │ │ │ ├── confusion_matrix.m │ │ │ ├── demo_get_train_test_split.m │ │ │ ├── demo_synched_projected_frames.m │ │ │ ├── eval_seg.m │ │ │ ├── get_accel_data.cpp │ │ │ ├── get_accel_data.m │ │ │ ├── get_accel_data.mexa64 │ │ │ ├── get_projected_depth.m │ │ │ ├── get_projection_mask.m │ │ │ ├── get_scene_counts.m │ │ │ ├── get_scene_counts_as_perc.m │ │ │ ├── get_scene_type_from_scene.m │ │ │ ├── get_synched_frames.m │ │ │ ├── get_train_test_split.m │ │ │ ├── maplabels.m │ │ │ ├── nyuv1_mapping.m │ │ │ ├── rgb_plane2rgb_world.m │ │ │ ├── savexyzl_fromv2.m │ │ │ ├── test_eval_seg.m │ │ │ ├── test_get_scene_counts_as_perc.m │ │ │ └── test_get_scene_type_from_scene.m │ │ └── uwrite │ │ │ ├── .DS_Store │ │ │ ├── README │ │ │ ├── uwrite.c │ │ │ └── uwrite.m │ └── v2 │ │ ├── mat2pcl │ │ ├── license.txt │ │ ├── loadpcd.m │ │ ├── lspcd.m │ │ ├── lzfd.m │ │ ├── pclviewer.m │ │ └── savepcd.m │ │ ├── prepare_v2_dataset.m │ │ ├── toolbox │ │ ├── README │ │ ├── apply_distortion.m │ │ ├── camera_params.m │ │ ├── cbf.cpp │ │ ├── cbf.h │ │ ├── cbf_windows.cpp │ │ ├── cbf_windows.h │ │ ├── compile.m │ │ ├── couprie_labeling.m │ │ ├── crop_image.m │ │ ├── demo_fill_depth_cross_bf_test.m │ │ ├── demo_project_depth_map.m │ │ ├── demo_synched_projected_frames.m │ │ ├── depth_plane2depth_world.m │ │ ├── depth_rel2depth_abs.m │ │ ├── depth_world2rgb_world.m │ │ ├── fill_depth_colorization.m │ │ ├── fill_depth_cross_bf.m │ │ ├── get_accel_data.cpp │ │ ├── get_accel_data.m │ │ ├── get_instance_masks.m │ │ ├── get_projection_mask.m │ │ ├── get_rgb_depth_overlay.m │ │ ├── get_scene_type_from_scene.m │ │ ├── get_synched_frames.m │ │ ├── get_timestamp_from_filename.m │ │ ├── maplabels.m │ │ ├── mex_cbf.cpp │ │ ├── mex_cbf_windows.cpp │ │ ├── project_depth_map.m │ │ ├── rgb_plane2rgb_world.m │ │ ├── rgb_world2rgb_plane.m │ │ ├── savexyzl.m │ │ ├── undistort.m │ │ └── undistort_depth.m │ │ └── uwrite │ │ ├── .DS_Store │ │ ├── README │ │ ├── uwrite.c │ │ └── uwrite.m ├── get_3dNet_Cat10.sh ├── get_3dNet_test_data.sh ├── get_TUW.sh └── get_caffe_network.sh └── setup.sh /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | # Project structure 3 | build*/ 4 | bin 5 | cfg/* 6 | cmake-build* 7 | data/ 8 | lib 9 | *~ 10 | debian/ 11 | obj-x86_64-linux-gnu/ 12 | 13 | # git backups 14 | *.orig 15 | *.autosave 16 | 17 | # CMake 18 | CMakeCache.txt 19 | CMakeFiles 20 | Makefile 21 | cmake_install.cmake 22 | install_manifest.txt 23 | 24 | # Qt cache 25 | CMakeLists.txt.user 26 | CMakeLists.txt.user.* 27 | 28 | #CLion 29 | .idea/* 30 | 31 | # Precompiled Headers 32 | *.gch 33 | *.pch 34 | 35 | # Compiled Dynamic libraries 36 | *.so 37 | *.dylib 38 | *.dll 39 | 40 | # Fortran module files 41 | *.mod 42 | 43 | # Compiled Static libraries 44 | *.lai 45 | *.la 46 | *.a 47 | *.lib 48 | 49 | # Executables 50 | *.exe 51 | *.out 52 | *.app 53 | 54 | # KDE temp files 55 | *.kate-swp 56 | .kdev_include_paths 57 | .kdev4 58 | *.kdev4 59 | 60 | 61 | # Multimedia files 62 | # to avoid overloading if needed use --force 63 | *.mov 64 | *.avi 65 | *.jpg 66 | *.bmp 67 | *.mpeg 68 | *.png 69 | *.bag 70 | -------------------------------------------------------------------------------- /3rdparty/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory(EDT) 2 | add_subdirectory(metslib) 3 | add_subdirectory(pcl_1_8) 4 | add_subdirectory(SiftGPU) 5 | add_subdirectory(opennurbs) 6 | add_subdirectory(on_nurbs) 7 | add_subdirectory(ceres) 8 | -------------------------------------------------------------------------------- /3rdparty/EDT/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(${EDT_LIBRARY}) 2 | 3 | v4r_assert(HAVE_PCL) 4 | 5 | v4r_include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${PCL_INCLUDE_DIRS}) 6 | 7 | set(lib_srcs 8 | propagation_distance_field.cpp 9 | ) 10 | 11 | SET(lib_hdrs 12 | distance_field.h 13 | voxel_grid.h 14 | propagation_distance_field.h 15 | ) 16 | 17 | add_library(${EDT_LIBRARY} STATIC ${lib_srcs}) 18 | target_link_libraries(${EDT_LIBRARY} ${PCL_LIBRARIES}) 19 | 20 | set_target_properties(${EDT_LIBRARY} 21 | PROPERTIES 22 | POSITION_INDEPENDENT_CODE TRUE 23 | OUTPUT_NAME "${EDT_LIBRARY}" 24 | ARCHIVE_OUTPUT_DIRECTORY ${3P_LIBRARY_OUTPUT_PATH} 25 | ) 26 | 27 | install(FILES ${lib_hdrs} DESTINATION "${V4R_3P_INCLUDE_INSTALL_PATH}/EDT") 28 | 29 | if(NOT BUILD_SHARED_LIBS) 30 | v4r_install_target(${EDT_LIBRARY} EXPORT V4RModules ARCHIVE DESTINATION ${V4R_3P_LIB_INSTALL_PATH} COMPONENT dev) 31 | endif() 32 | -------------------------------------------------------------------------------- /3rdparty/SiftGPU/.gitignore: -------------------------------------------------------------------------------- 1 | # These paths will be created and populated by the `ExternalProject_Add` 2 | # command when the "SiftGPU" target is built. 3 | src/ 4 | tmp/ 5 | SiftGPU.h 6 | -------------------------------------------------------------------------------- /3rdparty/ceres/.gitignore: -------------------------------------------------------------------------------- 1 | # These paths will be created and populated by the `ExternalProject_Add` 2 | # command when the "ceres" target is built. 3 | include/ 4 | lib/ 5 | share/ 6 | src/ 7 | tmp/ 8 | -------------------------------------------------------------------------------- /3rdparty/ceres/fix_eigen_vector.patch: -------------------------------------------------------------------------------- 1 | --- include/ceres/internal/numeric_diff.h 2016-12-05 16:45:15.000000000 +0100 2 | +++ include/ceres/internal/numeric_diff_fixed.h 2017-07-21 11:00:02.604489566 +0200 3 | @@ -38,7 +38,6 @@ 4 | #include 5 | 6 | #include "Eigen/Dense" 7 | -#include "Eigen/StdVector" 8 | #include "ceres/cost_function.h" 9 | #include "ceres/internal/fixed_array.h" 10 | #include "ceres/internal/scoped_ptr.h" 11 | -------------------------------------------------------------------------------- /3rdparty/gtest/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8.12) 2 | project(gtest NONE) 3 | include(ExternalProject) 4 | 5 | # Make a target that downloads gtest 6 | set(_external_target "gtest_external") 7 | ExternalProject_Add(${_external_target} 8 | URL "https://github.com/google/googletest/archive/release-1.8.0.tar.gz" 9 | URL_HASH SHA1=e7e646a6204638fe8e87e165292b8dd9cd4c36ed 10 | TIMEOUT 30 11 | CMAKE_ARGS "-DCMAKE_BUILD_TYPE=Release" "-DCMAKE_INSTALL_PREFIX=" "-DBUILD_GTEST=ON" "-DBUILD_GMOCK=OFF" 12 | ) 13 | 14 | # INSTALL_DIR is where the library was installed after building 15 | ExternalProject_Get_Property(${_external_target} INSTALL_DIR) 16 | 17 | # Let CMake know about the static libraries built by the external project target 18 | # gtest.a 19 | add_library(gtest STATIC IMPORTED GLOBAL) 20 | add_dependencies(gtest ${_external_target}) 21 | set_target_properties(gtest 22 | PROPERTIES 23 | IMPORTED_LOCATION "${INSTALL_DIR}/lib/libgtest.a" 24 | OUTPUT_NAME gtest 25 | ARCHIVE_OUTPUT_DIRECTORY ${3P_LIBRARY_OUTPUT_PATH} 26 | ) 27 | # gtest_main.a 28 | add_library(gtest_main STATIC IMPORTED GLOBAL) 29 | add_dependencies(gtest_main ${_external_target}) 30 | set_target_properties(gtest_main 31 | PROPERTIES 32 | IMPORTED_LOCATION "${INSTALL_DIR}/lib/libgtest_main.a" 33 | OUTPUT_NAME gtest_main 34 | ARCHIVE_OUTPUT_DIRECTORY ${3P_LIBRARY_OUTPUT_PATH} 35 | ) 36 | 37 | set(GTEST_INCLUDE_DIRS "${INSTALL_DIR}/include" CACHE INTERNAL "Google Test include directories") 38 | set(GTEST_LIBRARIES gtest gtest_main CACHE INTERNAL "Google Test libraries") 39 | set(GTEST_VERSION 1.8.0 CACHE INTERNAL "Google Test version") 40 | -------------------------------------------------------------------------------- /3rdparty/libsvm/.gitignore: -------------------------------------------------------------------------------- 1 | # These paths will be created and populated by the `ExternalProject_Add` 2 | # command when the "libsvm" target is built. 3 | src/ 4 | tmp/ 5 | svm.h 6 | -------------------------------------------------------------------------------- /3rdparty/libsvm/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(${LIBSVM_LIBRARY}) 2 | include(ExternalProject) 3 | 4 | # Make a target that downloads and builds LIBSVM from source. 5 | # The install command copies the (only) library header to the root libsvm directory. This is needed to allow using V4R 6 | # from without installation (directly from build/ location). 7 | set(_external_target "${LIBSVM_LIBRARY}_external") 8 | ExternalProject_Add(${_external_target} 9 | PREFIX "${CMAKE_CURRENT_LIST_DIR}" 10 | URL "https://github.com/cjlin1/libsvm/archive/v320.tar.gz" 11 | URL_HASH SHA256=e4be7fc8d2e7cb65feae4d6387967484c01c9dc818e7dfff515f663728a6f2ca 12 | TIMEOUT 30 13 | CONFIGURE_COMMAND "" 14 | BUILD_COMMAND make lib 15 | BUILD_IN_SOURCE 1 16 | INSTALL_COMMAND cp /svm.h ${CMAKE_CURRENT_SOURCE_DIR} 17 | ) 18 | 19 | # SOURCE_DIR is where the source was unpacked and then built. 20 | # We want to make this available outside of the scope of this file. 21 | ExternalProject_Get_Property(${_external_target} SOURCE_DIR) 22 | set(${LIBSVM_LIBRARY}_SOURCE_DIR ${SOURCE_DIR} CACHE INTERNAL "LIBSVM source directory") 23 | 24 | # Let CMake know about the shared library built by the external project target. 25 | add_library(${LIBSVM_LIBRARY} SHARED IMPORTED GLOBAL) 26 | add_dependencies(${LIBSVM_LIBRARY} ${_external_target}) 27 | set_target_properties(${LIBSVM_LIBRARY} 28 | PROPERTIES 29 | IMPORTED_LOCATION "${SOURCE_DIR}/libsvm.so.2" 30 | OUTPUT_NAME "${LIBSVM_LIBRARY}" 31 | ARCHIVE_OUTPUT_DIRECTORY ${3P_LIBRARY_OUTPUT_PATH} 32 | ) 33 | 34 | # Setup a rule to install header files 35 | install(FILES "${SOURCE_DIR}/svm.h" DESTINATION "${V4R_3P_INCLUDE_INSTALL_PATH}/libsvm") 36 | install(FILES "${SOURCE_DIR}/libsvm.so.2" DESTINATION ${V4R_3P_LIB_INSTALL_PATH}) 37 | 38 | if(NOT BUILD_SHARED_LIBS) 39 | message(WARNING "LIBSVM support is enabled, but it can only be built as as shared library.") 40 | endif() 41 | -------------------------------------------------------------------------------- /3rdparty/metslib/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(${METSLIB_LIBRARY}) 2 | install(DIRECTORY . DESTINATION "${V4R_3P_INCLUDE_INSTALL_PATH}/metslib") 3 | set(${METSLIB_LIBRARY}_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/.. CACHE INTERNAL "METSlib include directory") 4 | set(${METSLIB_LIBRARY}_VERSION "0.5.3" CACHE INTERNAL "METSlib version") 5 | -------------------------------------------------------------------------------- /3rdparty/on_nurbs/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(${ON_NURBS_LIBRARY}) 2 | include("on_nurbs.cmake") 3 | v4r_include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${PCL_INCLUDE_DIRS} ${OPENNURBS_INCLUDE_DIRS}) 4 | 5 | add_library(${ON_NURBS_LIBRARY} STATIC ${ON_NURBS_SOURCES}) 6 | add_dependencies(${ON_NURBS_LIBRARY} ${OPENNURBS_LIBRARY}) 7 | target_link_libraries(${ON_NURBS_LIBRARY} ${PCL_LIBRARIES}) 8 | 9 | set_target_properties(${ON_NURBS_LIBRARY} 10 | PROPERTIES 11 | POSITION_INDEPENDENT_CODE TRUE 12 | OUTPUT_NAME "${ON_NURBS_LIBRARY}" 13 | ARCHIVE_OUTPUT_DIRECTORY ${3P_LIBRARY_OUTPUT_PATH} 14 | ) 15 | 16 | install(FILES ${ON_NURBS_INCLUDES} DESTINATION "${V4R_3P_INCLUDE_INSTALL_PATH}/on_nurbs") 17 | 18 | if(NOT BUILD_SHARED_LIBS) 19 | v4r_install_target(${ON_NURBS_LIBRARY} EXPORT V4RModules ARCHIVE DESTINATION ${V4R_3P_LIB_INSTALL_PATH} COMPONENT dev) 20 | endif() 21 | -------------------------------------------------------------------------------- /3rdparty/on_nurbs/on_nurbs.cmake: -------------------------------------------------------------------------------- 1 | set(ON_NURBS_INCLUDES 2 | closing_boundary.h 3 | fitting_curve_2d_apdm.h 4 | fitting_curve_2d_asdm.h 5 | fitting_curve_2d_atdm.h 6 | fitting_curve_2d_pdm.h 7 | fitting_curve_2d_sdm.h 8 | fitting_curve_2d_tdm.h 9 | fitting_curve_2d.h 10 | fitting_curve_pdm.h 11 | fitting_cylinder_pdm.h 12 | fitting_sphere_pdm.h 13 | fitting_surface_im.h 14 | fitting_surface_pdm.h 15 | fitting_surface_tdm.h 16 | global_optimization_pdm.h 17 | global_optimization_tdm.h 18 | nurbs_data.h 19 | nurbs_solve.h 20 | nurbs_tools.h 21 | sequential_fitter.h 22 | sparse_mat.h 23 | triangulation.h) 24 | 25 | set(ON_NURBS_SOURCES 26 | closing_boundary.cpp 27 | fitting_curve_2d_apdm.cpp 28 | fitting_curve_2d_asdm.cpp 29 | fitting_curve_2d_atdm.cpp 30 | fitting_curve_2d_pdm.cpp 31 | fitting_curve_2d_sdm.cpp 32 | fitting_curve_2d_tdm.cpp 33 | fitting_curve_2d.cpp 34 | fitting_curve_pdm.cpp 35 | fitting_cylinder_pdm.cpp 36 | fitting_sphere_pdm.cpp 37 | fitting_surface_im.cpp 38 | fitting_surface_pdm.cpp 39 | fitting_surface_tdm.cpp 40 | global_optimization_pdm.cpp 41 | global_optimization_tdm.cpp 42 | nurbs_tools.cpp 43 | sequential_fitter.cpp 44 | sparse_mat.cpp 45 | triangulation.cpp) 46 | 47 | SET(USE_UMFPACK 0 CACHE BOOL "Use UmfPack for solving sparse systems of equations (e.g. in surface/on_nurbs)" ) 48 | IF(USE_UMFPACK) 49 | set(ON_NURBS_SOURCES ${ON_NURBS_SOURCES} nurbs_solve_umfpack.cpp) 50 | set(ON_NURBS_LIBRARIES ${ON_NURBS_LIBRARIES} cholmod umfpack) 51 | ELSE(USE_UMFPACK) 52 | set(ON_NURBS_SOURCES ${ON_NURBS_SOURCES} nurbs_solve_eigen.cpp) 53 | ENDIF(USE_UMFPACK) 54 | 55 | -------------------------------------------------------------------------------- /3rdparty/opennurbs/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(${OPENNURBS_LIBRARY}) 2 | include("openNURBS.cmake") 3 | v4r_include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${PCL_INCLUDE_DIRS}) 4 | 5 | add_library(${OPENNURBS_LIBRARY} STATIC ${OPENNURBS_SOURCES}) 6 | target_link_libraries(${OPENNURBS_LIBRARY} ${PCL_LIBRARIES}) 7 | 8 | set_target_properties(${OPENNURBS_LIBRARY} 9 | PROPERTIES 10 | POSITION_INDEPENDENT_CODE TRUE 11 | OUTPUT_NAME "${OPENNURBS_LIBRARY}" 12 | ARCHIVE_OUTPUT_DIRECTORY ${3P_LIBRARY_OUTPUT_PATH} 13 | ) 14 | 15 | install(FILES ${OPENNURBS_INCLUDES} DESTINATION "${V4R_3P_INCLUDE_INSTALL_PATH}/opennurbs") 16 | 17 | if(NOT BUILD_SHARED_LIBS) 18 | v4r_install_target(${OPENNURBS_LIBRARY} EXPORT V4RModules ARCHIVE DESTINATION ${V4R_3P_LIB_INSTALL_PATH} COMPONENT dev) 19 | endif() 20 | -------------------------------------------------------------------------------- /3rdparty/opennurbs/examples_linking_pragmas.h: -------------------------------------------------------------------------------- 1 | #if defined(_MSC_VER) 2 | 3 | // This file is specific to Micrsoft's compiler. 4 | // It contains linking pragmas for building the opennurbs examples. 5 | 6 | #pragma once 7 | 8 | #if defined(ON_DLL_EXPORTS) 9 | // If you get the following error, your compiler settings 10 | // indicate you are building opennurbs as a DLL. This file 11 | // is used for linking with opennurbs. 12 | #error This file contains linking pragmas for using opennurbs. 13 | #endif 14 | 15 | #if !defined(ON_MSC_SOLUTION_DIR) 16 | #define ON_MSC_SOLUTION_DIR ".." 17 | #endif 18 | 19 | #if !defined(ON_MSC_LIB_DIR) 20 | 21 | #if defined(WIN64) 22 | 23 | // x64 (64 bit) static libraries 24 | 25 | #if defined(NDEBUG) 26 | 27 | // Release x64 (64 bit) libs 28 | #define ON_MSC_LIB_DIR "x64/Release" 29 | 30 | #else // _DEBUG 31 | 32 | // Debug x64 (64 bit) libs 33 | #define ON_MSC_LIB_DIR "x64/Debug" 34 | 35 | #endif // NDEBUG else _DEBUG 36 | 37 | #else // WIN32 38 | 39 | // x86 (32 bit) static libraries 40 | 41 | #if defined(NDEBUG) 42 | 43 | // Release x86 (32 bit) libs 44 | #define ON_MSC_LIB_DIR "Release" 45 | 46 | #else // _DEBUG 47 | 48 | // Debug x86 (32 bit) libs 49 | #define ON_MSC_LIB_DIR "Debug" 50 | 51 | #endif // NDEBUG else _DEBUG 52 | 53 | #endif // WIN64 else WIN32 54 | 55 | #endif // !defined(ON_MSC_LIB_DIR) 56 | 57 | #if defined(ON_DLL_IMPORTS) 58 | #pragma message( " --- dynamically linking opennurbs (DLL)." ) 59 | #pragma comment(lib, "\"" ON_MSC_SOLUTION_DIR "/" ON_MSC_LIB_DIR "/" "opennurbs.lib" "\"") 60 | #else 61 | #pragma message( " --- statically linking opennurbs." ) 62 | #pragma comment(lib, "\"" ON_MSC_SOLUTION_DIR "/" ON_MSC_LIB_DIR "/" "zlib.lib" "\"") 63 | #pragma comment(lib, "\"" ON_MSC_SOLUTION_DIR "/" ON_MSC_LIB_DIR "/" "opennurbs_staticlib.lib" "\"") 64 | #endif 65 | 66 | 67 | #endif 68 | -------------------------------------------------------------------------------- /3rdparty/opennurbs/inffast.h: -------------------------------------------------------------------------------- 1 | /* inffast.h -- header to use inffast.c 2 | * Copyright (C) 1995-2003 Mark Adler 3 | * For conditions of distribution and use, see copyright notice in zlib.h 4 | */ 5 | 6 | /* WARNING: this file should *not* be used by applications. It is 7 | part of the implementation of the compression library and is 8 | subject to change. Applications should only use zlib.h. 9 | */ 10 | 11 | void inflate_fast OF((z_streamp strm, unsigned start)); 12 | -------------------------------------------------------------------------------- /3rdparty/opennurbs/opennurbs_dll_resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by opennurbs.rc 4 | 5 | // Next default values for new objects 6 | // 7 | #ifdef APSTUDIO_INVOKED 8 | #ifndef APSTUDIO_READONLY_SYMBOLS 9 | #define _APS_NEXT_RESOURCE_VALUE 101 10 | #define _APS_NEXT_COMMAND_VALUE 40001 11 | #define _APS_NEXT_CONTROL_VALUE 1001 12 | #define _APS_NEXT_SYMED_VALUE 101 13 | #endif 14 | #endif 15 | -------------------------------------------------------------------------------- /3rdparty/opennurbs/opennurbs_error_message.cpp: -------------------------------------------------------------------------------- 1 | /* $NoKeywords: $ */ 2 | /* 3 | // 4 | // Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. 5 | // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert 6 | // McNeel & Associates. 7 | // 8 | // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. 9 | // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF 10 | // MERCHANTABILITY ARE HEREBY DISCLAIMED. 11 | // 12 | // For complete openNURBS copyright information see . 13 | // 14 | //////////////////////////////////////////////////////////////// 15 | */ 16 | 17 | #include "opennurbs.h" 18 | 19 | 20 | void ON_ErrorMessage( 21 | int message_type, // 0=warning - serious problem that code is designed to handle 22 | // 1=error - serious problem code will attempt to handle 23 | // The thing causing the error is a bug that must 24 | // be fixed. 25 | // 2=assert failed - crash is nearly certain 26 | const char* sErrorMessage 27 | ) 28 | { 29 | // error/warning/assert message is in sMessage[] buffer. Modify this function 30 | // to do whatever you want to with the message. 31 | if ( sErrorMessage && sErrorMessage[0] ) 32 | { 33 | 34 | #if defined(ON_PURIFY_BUILD) && defined(ON_32BIT_POINTER) 35 | // 10 December 2003 Dale Lear 36 | // Make ON_ERROR/ON_WARNING messages show up in Purify 37 | PurifyPrintf("%s",sErrorMessage); 38 | #endif 39 | 40 | #if defined(ON_OS_WINDOWS) 41 | ::OutputDebugStringA( "\n" ); 42 | ::OutputDebugStringA( sErrorMessage ); 43 | ::OutputDebugStringA( "\n" ); 44 | #else 45 | #if defined(ON__DEBUG) 46 | // not using OutputDebugStringA 47 | printf("\n%s\n",sErrorMessage); 48 | #endif 49 | #endif 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /3rdparty/opennurbs/opennurbs_version.h: -------------------------------------------------------------------------------- 1 | /* $NoKeywords: $ */ 2 | /* 3 | // 4 | // Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. 5 | // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert 6 | // McNeel & Associates. 7 | // 8 | // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. 9 | // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF 10 | // MERCHANTABILITY ARE HEREBY DISCLAIMED. 11 | // 12 | // For complete openNURBS copyright information see . 13 | // 14 | //////////////////////////////////////////////////////////////// 15 | */ 16 | 17 | 18 | #if !defined(OPENNURBS_VERSION_DEFINITION) 19 | #error Do NOT include opennurbs_version.h in your code. Use ON::Version() instead. 20 | #endif 21 | 22 | 23 | // OpenNURBS users: 24 | // Do not change OPENNURBS_VERSION or the OpenNURBS code 25 | // that reads 3DM files not work correctly. 26 | #define OPENNURBS_VERSION 201209145 27 | 28 | // Subversion revision and branch used for source code. 29 | #define OPENNURBS_SRC_SVN_REVISION "85828" 30 | #define OPENNURBS_SRC_SVN_BRANCH ".../opennurbs_public/2012-09-14-0000/opennurbs" 31 | 32 | // Subversion revision and branch used for documentation. 33 | #define OPENNURBS_DOC_SVN_REVISION "85828" 34 | #define OPENNURBS_DOC_SVN_BRANCH ".../opennurbs_public/2012-09-14-0000/opennurbs" 35 | -------------------------------------------------------------------------------- /3rdparty/opennurbs/opennurbs_zlib_memory.cpp: -------------------------------------------------------------------------------- 1 | /* $NoKeywords: $ */ 2 | /* 3 | // 4 | // Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. 5 | // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert 6 | // McNeel & Associates. 7 | // 8 | // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. 9 | // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF 10 | // MERCHANTABILITY ARE HEREBY DISCLAIMED. 11 | // 12 | // For complete openNURBS copyright information see . 13 | // 14 | //////////////////////////////////////////////////////////////// 15 | */ 16 | 17 | #include "opennurbs.h" 18 | 19 | // If you are using opennurbs as a statically linked library, then 20 | // you may make calls to the same zlib that opennurbs uses. This 21 | // zlib is compiled with z_ symbol projectection. All the necessary 22 | // header files are included by opennurbs.h. 23 | // 24 | // If you are using opennurbs as a DLL or writing a Rhino plug-in 25 | // and you want to use the same zlib that opennurbs uses, then 26 | // compile opennurbs_zlib_memory.cpp (this file) into your application 27 | // and statically link with the zlib library. All the necessary 28 | // header files are included by opennurbs.h. 29 | 30 | 31 | voidpf zcalloc (voidpf, unsigned items, unsigned size) 32 | { 33 | return oncalloc(items, size); 34 | } 35 | 36 | void zcfree (voidpf, voidpf ptr) 37 | { 38 | onfree(ptr); 39 | } 40 | -------------------------------------------------------------------------------- /3rdparty/pcl_1_8/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(${PCL_1_8_LIBRARY}) 2 | # This project contains files from PCL which are either not available in or have a different ABI than the currently released PCL version. 3 | v4r_assert(HAVE_PCL) 4 | v4r_assert(HAVE_BOOST) 5 | 6 | v4r_include_directories( 7 | ${PCL_INCLUDE_DIRS} 8 | ${BOOST_INCLUDE_DIRS} 9 | ${CMAKE_CURRENT_SOURCE_DIR} 10 | ) 11 | 12 | set(lib_srcs 13 | uniform_sampling.cpp 14 | conditional_euclidean_clustering.cpp 15 | organized_edge_detection.cpp 16 | convolution_2d.cpp 17 | 18 | ) 19 | 20 | SET(lib_hdrs 21 | pcl_1_8/keypoints/impl/uniform_sampling.hpp 22 | pcl_1_8/segmentation/impl/conditional_euclidean_clustering.hpp 23 | pcl_1_8/features/impl/organized_edge_detection.hpp 24 | pcl_1_8/2d/impl/convolution.hpp 25 | pcl_1_8/2d/impl/kernel.hpp 26 | pcl_1_8/2d/impl/edge.hpp 27 | pcl_1_8/keypoints/uniform_sampling.h 28 | pcl_1_8/segmentation/conditional_euclidean_clustering.h 29 | pcl_1_8/features/organized_edge_detection.h 30 | pcl_1_8/2d/edge.h 31 | pcl_1_8/2d/convolution.h 32 | pcl_1_8/2d/kernel.h 33 | ) 34 | 35 | include_directories( 36 | ${PCL_INCLUDE_DIRS} 37 | ${CMAKE_CURRENT_SOURCE_DIR} 38 | ) 39 | 40 | add_library(${PCL_1_8_LIBRARY} STATIC ${lib_srcs} ${lib_hdrs} ) 41 | target_link_libraries(${PCL_1_8_LIBRARY} ${PCL_LIBRARIES} ) 42 | 43 | set_target_properties(${PCL_1_8_LIBRARY} 44 | PROPERTIES 45 | POSITION_INDEPENDENT_CODE TRUE 46 | OUTPUT_NAME "${PCL_1_8_LIBRARY}" 47 | ARCHIVE_OUTPUT_DIRECTORY ${3P_LIBRARY_OUTPUT_PATH} 48 | ) 49 | 50 | install(FILES ${lib_hdrs} DESTINATION "${V4R_3P_INCLUDE_INSTALL_PATH}/pcl_1_8") 51 | 52 | if(NOT BUILD_SHARED_LIBS) 53 | v4r_install_target(${PCL_1_8_LIBRARY} EXPORT V4RModules ARCHIVE DESTINATION ${V4R_3P_LIB_INSTALL_PATH} COMPONENT dev) 54 | endif() 55 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | Thomas Fäulhammer 2 | Sergey Alexandrov 3 | Michael Zillich 4 | Johann Prankl 5 | Aitor Aldoma 6 | Markus 'bajo' Bajones 7 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015, Vision4Robotics group, TU Vienna 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to 5 | deal in the Software without restriction, including without limitation the 6 | rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 7 | sell copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | SOFTWARE. 20 | 21 | 22 | -------------------------------------------------------------------------------- /Readme.md: -------------------------------------------------------------------------------- 1 | [![build status](https://rgit.acin.tuwien.ac.at/root/v4r/badges/master/build.svg)](https://rgit.acin.tuwien.ac.at/root/v4r/commits/master) 2 | 3 | The library itself is independent of ROS, so it is built outside ROS catkin. There are wrappers for ROS (https://github.com/strands-project/v4r_ros_wrappers), which can then be placed inside the normal catkin workspace. 4 | 5 | # Dependencies: 6 | stated in [`package.xml`](https://github.com/strands-project/v4r/blob/master/package.xml) 7 | There are two options to use the SIFT recognizer: 8 | - Use V4R third party library SIFT GPU (this requires a decent GPU - see www.cs.unc.edu/~ccwu/siftgpu) [default] 9 | - Use OpenCV non-free SIFT implementation (this requires the non-free module of OpenCV - can be installed from source). This option is enabled if BUILD_SIFTGPU is disabled in cmake. 10 | 11 | # Installation: 12 | In order to use V4R in ROS, use the [v4r_ros_wrappers](https://github.com/strands-project/v4r_ros_wrappers/blob/master/Readme.md). 13 | 14 | ## From Ubuntu Package 15 | simply install `sudo apt-get install ros-indigo-v4r` after enabling the [STRANDS repositories](https://github.com/strands-project-releases/strands-releases/wiki#using-the-strands-repository). 16 | 17 | ## From Source 18 | ``` 19 | cd ~/somewhere 20 | git clone 'https://rgit.acin.tuwien.ac.at/root/v4r.git' 21 | cd v4r 22 | ./setup.sh 23 | mkdir build 24 | cd build 25 | cmake .. 26 | make 27 | sudo make install (optional) 28 | ``` 29 | 30 | ## Notes 31 | ### Caffe 32 | If you want to use CNN feature extraction, you need to install the Caffe library. We recommend to use CMake-based installation for Caffe and provide the install folder to V4R's cmake call as 33 | ``` 34 | cmake .. -DCaffe_DIR=/your_caffe_ws/build/install/share/Caffe 35 | ``` 36 | 37 | 38 | ### Ceres 39 | To avoid issues with Ceres when building shared libraries, we recommend to build and install Ceres from source. -------------------------------------------------------------------------------- /apps/3D_scene_reconstruction_by_SIFT_and_MST/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | SET(3D_SCENE_RECONSTRUCTION_BY_SIFT_AND_MST_DEPS v4r_core v4r_registration v4r_io v4r_common v4r_features) 2 | v4r_check_dependencies(${3D_SCENE_RECONSTRUCTION_BY_SIFT_AND_MST_DEPS}) 3 | 4 | if(NOT V4R_DEPENDENCIES_FOUND) 5 | message(***3D_SCENE_RECONSTRUCTION_BY_SIFT_AND_MST_DEPS does not meed dependencies*****) 6 | return() 7 | endif() 8 | 9 | find_package(PkgConfig REQUIRED) 10 | pkg_search_module(GL REQUIRED gl) 11 | 12 | v4r_include_directories("${CMAKE_CURRENT_SOURCE_DIR}") 13 | v4r_include_modules(${3D_SCENE_RECONSTRUCTION_BY_SIFT_AND_MST_DEPS}) 14 | 15 | if(WIN32) 16 | link_directories(${CMAKE_CURRENT_BINARY_DIR}) 17 | endif() 18 | 19 | if(HAVE_PCL) 20 | v4r_include_directories(${PCL_INCLUDE_DIRS}) 21 | list(APPEND DEP_LIBS ${PCL_LIBRARIES}) 22 | v4r_include_directories(${PCL_1_8_INCLUDE_DIRS}) 23 | list(APPEND DEP_LIBS ${PCL_1_8_LIBRARIES}) 24 | endif() 25 | 26 | if(HAVE_OPENCV) 27 | v4r_include_directories(${OpenCV_INCLUDE_DIRS}) 28 | list(APPEND DEP_LIBS ${OpenCV_LIBS}) 29 | endif() 30 | 31 | if(HAVE_SIFTGPU) 32 | v4r_include_directories(${SIFTGPU_INCLUDE_DIRS}) 33 | list(APPEND DEP_LIBS ${SIFTGPU_LIBRARIES}) 34 | endif() 35 | 36 | if(HAVE_OPENGL) 37 | v4r_include_directories(${OPENGL_INCLUDE_DIRS}) 38 | list(APPEND DEP_LIBS ${OPENGL_LIBRARIES}) 39 | endif() 40 | 41 | add_executable(3dReconstructionBySiftAndMST main.cpp) 42 | target_link_libraries(3dReconstructionBySiftAndMST ${3D_SCENE_RECONSTRUCTION_BY_SIFT_AND_MST_DEPS} ${DEP_LIBS}) 43 | 44 | INSTALL(TARGETS 3dReconstructionBySiftAndMST 45 | RUNTIME DESTINATION bin 46 | LIBRARY DESTINATION lib 47 | ARCHIVE DESTINATION lib 48 | ) 49 | 50 | -------------------------------------------------------------------------------- /apps/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory(segmentation) 2 | add_subdirectory(3D_scene_reconstruction_by_SIFT_and_MST) 3 | add_subdirectory(RTMT) 4 | #add_subdirectory(ObjectGroundTruthAnnotator) 5 | add_subdirectory(AttentionSegmentation) 6 | add_subdirectory(ObjectRecognizer) 7 | add_subdirectory(semantic_segmentation) 8 | -------------------------------------------------------------------------------- /apps/ConvertTransformationMatrixIntoPCDpose/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | SET(V4R_SAVE_POSE_INTO_PCD_DEPS v4r_io v4r_core v4r_common) 2 | v4r_check_dependencies(${V4R_SAVE_POSE_INTO_PCD_DEPS}) 3 | 4 | if(NOT V4R_DEPENDENCIES_FOUND) 5 | return() 6 | endif() 7 | 8 | v4r_include_modules(${V4R_SAVE_POSE_INTO_PCD_DEPS}) 9 | 10 | if(HAVE_PCL) 11 | v4r_include_directories(${PCL_INCLUDE_DIRS}) 12 | list(APPEND V4R_SAVE_POSE_INTO_PCD_DEPS ${PCL_LIBRARIES} ${BOOST_LIBRARIES}) 13 | endif() 14 | 15 | 16 | project(save_transformation_matrix_into_pcd_header) 17 | 18 | set(the_target v4r_save_transformation_matrix_into_pcd_header) 19 | 20 | 21 | add_executable(${the_target} save_pose_into_pcd.cpp) 22 | target_link_libraries(${the_target} ${V4R_SAVE_POSE_INTO_PCD_DEPS}) 23 | 24 | set_target_properties(${the_target} PROPERTIES 25 | DEBUG_POSTFIX "${V4R_DEBUG_POSTFIX}" 26 | ARCHIVE_OUTPUT_DIRECTORY ${LIBRARY_OUTPUT_PATH} 27 | RUNTIME_OUTPUT_DIRECTORY ${EXECUTABLE_OUTPUT_PATH} 28 | INSTALL_NAME_DIR lib 29 | OUTPUT_NAME ${the_target}) 30 | 31 | if(ENABLE_SOLUTION_FOLDERS) 32 | set_target_properties(${the_target} PROPERTIES FOLDER "applications") 33 | endif() 34 | 35 | if(INSTALL_CREATE_DISTRIB) 36 | if(BUILD_SHARED_LIBS) 37 | install(TARGETS ${the_target} RUNTIME DESTINATION ${V4R_BIN_INSTALL_PATH} CONFIGURATIONS Release COMPONENT dev) 38 | endif() 39 | else() 40 | install(TARGETS ${the_target} RUNTIME DESTINATION ${V4R_BIN_INSTALL_PATH} COMPONENT dev) 41 | endif() 42 | -------------------------------------------------------------------------------- /apps/MultiViewObjectRecognizer/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | SET(OR_DEPS v4r_core v4r_common v4r_io v4r_features v4r_keypoints v4r_segmentation v4r_recognition v4r_ml) 2 | v4r_check_dependencies(${OR_DEPS}) 3 | 4 | if(NOT V4R_DEPENDENCIES_FOUND) 5 | message(***MVObjectRecognizer does not meet dependencies*****) 6 | return() 7 | endif() 8 | 9 | v4r_include_directories("${CMAKE_CURRENT_SOURCE_DIR}") 10 | v4r_include_modules(${OR_DEPS}) 11 | 12 | if(HAVE_PCL) 13 | v4r_include_directories(${PCL_INCLUDE_DIRS}) 14 | list(APPEND DEP_LIBS ${PCL_LIBRARIES}) 15 | endif() 16 | 17 | if(HAVE_OPENCV) 18 | v4r_include_directories(${OpenCV_INCLUDE_DIRS}) 19 | list(APPEND DEP_LIBS ${OpenCV_LIBS}) 20 | endif() 21 | 22 | if(HAVE_EDT) 23 | v4r_include_directories(${EDT_INCLUDE_DIRS}) 24 | list(APPEND DEP_LIBS ${EDT_LIBRARIES}) 25 | endif() 26 | 27 | if(HAVE_CERES) 28 | v4r_include_directories(${CERES_INCLUDE_DIRS}) 29 | list(APPEND DEP_LIBS ${CERES_LIBRARIES}) 30 | endif() 31 | 32 | if(HAVE_LIBSVM) 33 | v4r_include_directories(${LIBSVM_INCLUDE_DIRS}) 34 | list(APPEND DEP_LIBS ${LIBSVM_LIBRARIES}) 35 | endif() 36 | 37 | if(HAVE_GLOG) 38 | v4r_include_directories(${GLOG_INCLUDE_DIRS}) 39 | list(APPEND DEP_LIBS ${GLOG_LIBRARIES}) 40 | endif() 41 | 42 | if(HAVE_BOOST) 43 | v4r_include_directories(${BOOST_INCLUDE_DIRS}) 44 | list(APPEND DEP_LIBS ${BOOST_LIBRARIES}) 45 | endif() 46 | 47 | set(incs visualization.h) 48 | set(srcs visualization.cpp main.cpp) 49 | 50 | add_executable(MVObjectRecognizer ${incs} ${srcs}) 51 | target_link_libraries(MVObjectRecognizer ${OR_DEPS} ${DEP_LIBS}) 52 | 53 | INSTALL(TARGETS MVObjectRecognizer 54 | RUNTIME DESTINATION bin 55 | LIBRARY DESTINATION lib 56 | ARCHIVE DESTINATION lib 57 | ) 58 | -------------------------------------------------------------------------------- /apps/MultiViewObjectRecognizer/cfg/camera.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 640 6 | 480 7 | 5.250000000e+02 8 | 3.195000000e+02 9 | 2.395000000e+02 10 | 5.800000000e+01 11 | 12 | -------------------------------------------------------------------------------- /apps/MultiViewObjectRecognizer/cfg/esf_config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 1 6 | 1.200000048e+00 7 | 5.000000000e-01 8 | 1 9 | 6.000000000e+01 10 | 0.000000000e+00 11 | 1 12 | 1 13 | 14 | -------------------------------------------------------------------------------- /apps/MultiViewObjectRecognizer/cfg/shot_config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 512 6 | 1 7 | 3.402823466e+38 8 | 1.000000000e+00 9 | 1 10 | 3.402823466e+38 11 | 1 12 | 1000 13 | 3.999999911e-02 14 | 1.999999955e-02 15 | 0 16 | 5 17 | 1.500000000e+01 18 | 19 | -------------------------------------------------------------------------------- /apps/MultiViewObjectRecognizer/cfg/sift_config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 512 6 | 3 7 | 3.402823466e+38 8 | 1.000000000e+00 9 | 1 10 | 3.402823466e+38 11 | 0 12 | 1000 13 | 3.999999911e-02 14 | 1.999999955e-02 15 | 1 16 | 5 17 | 1.500000000e+01 18 | 19 | -------------------------------------------------------------------------------- /apps/ObjectGroundTruthAnnotator/GT6DOF.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * GT6DOF.cpp 3 | * 4 | * Created on: May 27, 2013 5 | * Author: aitor 6 | */ 7 | 8 | #include 9 | #include 10 | 11 | #include 12 | #include "main_window.h" 13 | 14 | //../build/bin/GT6DOF -models_dir /home/aitor/data/Mians_dataset/models_with_rhino -model_scale 0.001 -pcd_file /home/aitor/data/Mians_dataset/scenes/pcl_scenes/ -GT_DIR /home/aitor/data/Mians_dataset/gt_or_format_copy/ -training_dir /home/aitor/data/Mians_trained_models_voxelsize_0.003/ 15 | //../build/bin/GT6DOF -models_dir /home/aitor/data/queens_dataset/pcd_models/ -model_scale 0.001 -pcd_file /home/aitor/data/queens_dataset/pcd_scenes_with_gt/ -training_dir /home/aitor/data/queens_dataset/trained_models -GT_DIR /home/aitor/data/queens_dataset/gt_or_format_copy/ -training_dir /home/aitor/data/queens_dataset/trained_models 16 | int main (int argc, char* argv[]) 17 | { 18 | 19 | //create qt window 20 | MainWindow(argc, argv); 21 | return 0; 22 | } 23 | -------------------------------------------------------------------------------- /apps/ObjectGroundTruthAnnotator/or_evaluator.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * or_evaluator.cpp 3 | * 4 | * Created on: Mar 12, 2013 5 | * Author: aitor 6 | */ 7 | 8 | #include "or_evaluator.hpp" 9 | 10 | template class faat_pcl::rec_3d_framework::or_evaluator::OREvaluator; 11 | template class faat_pcl::rec_3d_framework::or_evaluator::OREvaluator; 12 | template class faat_pcl::rec_3d_framework::or_evaluator::OREvaluator; 13 | -------------------------------------------------------------------------------- /apps/ObjectRecognizer/cfg/camera.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 640 6 | 480 7 | 525 8 | 525 9 | 3.195000000e+02 10 | 2.395000000e+02 11 | 5.800000000e+01 12 | 13 | -------------------------------------------------------------------------------- /apps/ObjectRecognizer/cfg/global_config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 0 6 | 1.2 7 | 0.5 8 | 1 9 | 60 10 | 0.0 11 | 1 12 | 1 13 | 14 | -------------------------------------------------------------------------------- /apps/ObjectRecognizer/cfg/multipipeline_config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 0.01 6 | 5 7 | 0.5 8 | 1 9 | 1 10 | 1 11 | 1 12 | 13 | 1 14 | 0 15 | 2208 16 | 17 | 18 | 0 19 | 0 20 | 21 | 1 22 | 2 23 | 24 | 2 25 | 0 26 | 0.04 27 | 0.08 28 | 29 | 2.8 30 | 0 31 | 0.02 32 | 20000 33 | 0 34 | 1 35 | 0 36 | 0 37 | 3 38 | 39 | -------------------------------------------------------------------------------- /apps/ObjectRecognizer/cfg/shot_config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 512 6 | 4 7 | 1 8 | 5 9 | 10 10 | 1 11 | 1.8 12 | 1 13 | 1000 14 | 0.04 15 | 0.02 16 | 0 17 | 3 18 | 2 19 | 1 20 | 21 | -------------------------------------------------------------------------------- /apps/ObjectRecognizer/cfg/sift_config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 512 6 | 4 7 | 5 8 | 3.402823466e+38 9 | 1. 10 | 1 11 | 3.402823466e+38 12 | 0 13 | 1000 14 | 0.04 15 | 0.02 16 | 1 17 | 2 18 | 2.0 19 | 1 20 | 21 | -------------------------------------------------------------------------------- /apps/ObjectRecognizer/cfg/xtion_depth_mask.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strands-project/v4r/7cb817e05cb9d99cb2f68db009c27d7144d07f09/apps/ObjectRecognizer/cfg/xtion_depth_mask.png -------------------------------------------------------------------------------- /apps/ObjectRecognizer/check_hypotheses.cpp: -------------------------------------------------------------------------------- 1 | // -g /media/Data/datasets/TUW/annotations/ -r /media/Data/datasets/TUW/object_recognition_results_xyz -t /media/Data/datasets/TUW/test_set -m /media/Data/datasets/TUW/models --use_generated_hypotheses -v 2 | 3 | #include 4 | 5 | int 6 | main (int argc, char ** argv) 7 | { 8 | std::vector arguments(argv + 1, argv + argc); 9 | v4r::apps::RecognitionEvaluator e; 10 | arguments = e.init(arguments); 11 | 12 | if( !arguments.empty() ) 13 | { 14 | std::cout << "Unused parameters: " << std::endl; 15 | for(const std::string &p : arguments) 16 | std::cout << p << " "; 17 | std::cout << std::endl; 18 | } 19 | e.checkIndividualHypotheses(); 20 | return 0; 21 | } 22 | -------------------------------------------------------------------------------- /apps/ObjectRecognizer/compute_recognition_rate.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | // -m /media/Data/datasets/TUW/models/ -t /media/Data/datasets/TUW/validation_set/ -g /media/Data/datasets/TUW/annotations/ -r /home/thomas/recognition_results_eval/ 4 | 5 | int 6 | main (int argc, char ** argv) 7 | { 8 | std::vector arguments(argv + 1, argv + argc); 9 | v4r::apps::RecognitionEvaluator e; 10 | arguments = e.init(arguments); 11 | 12 | if( !arguments.empty() ) 13 | { 14 | std::cout << "Unused parameters: " << std::endl; 15 | for(const std::string &p : arguments) 16 | std::cout << p << " "; 17 | std::cout << std::endl; 18 | } 19 | 20 | size_t tp, fp, fn; 21 | e.compute_recognition_rate(tp,fp,fn); 22 | 23 | float precision = (float)tp / (tp + fp); 24 | float recall = (float)tp / (tp + fn); 25 | float fscore = 2 * precision * recall / (precision + recall); 26 | 27 | // double score = 4*recall + precision - median_time_ms*0.01*0.01; // we want to get as much hypotheses as possible - precision will be improved with verification 28 | 29 | std::cout << "tp: " << tp << ", fp: " << fp << ", fn: " << fn 30 | << ", precision: " << precision << ", recall: " << recall << ", fscore: " << fscore << std::endl; 31 | 32 | 33 | return 0; 34 | } 35 | -------------------------------------------------------------------------------- /apps/ObjectRecognizer/compute_recognition_rate_over_occlusion.cpp: -------------------------------------------------------------------------------- 1 | // -g /media/Data/datasets/TUW/annotations/ -r /home/thomas/recognition_results_eval/ -m /media/Data/datasets/TUW/models/ 2 | 3 | #include 4 | 5 | int 6 | main (int argc, char ** argv) 7 | { 8 | std::vector arguments(argv + 1, argv + argc); 9 | v4r::apps::RecognitionEvaluator e; 10 | arguments = e.init(arguments); 11 | 12 | if( !arguments.empty() ) 13 | { 14 | std::cout << "Unused parameters: " << std::endl; 15 | for(const std::string &p : arguments) 16 | std::cout << p << " "; 17 | std::cout << std::endl; 18 | } 19 | float recognition_rate = e.compute_recognition_rate_over_occlusion(); 20 | return 0; 21 | } 22 | -------------------------------------------------------------------------------- /apps/RTMT/main.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * $Id$ 3 | * 4 | * Software License Agreement (GNU General Public License) 5 | * 6 | * Copyright (C) 2015: 7 | * 8 | * Johann Prankl, prankl@acin.tuwien.ac.at 9 | * Aitor Aldoma, aldoma@acin.tuwien.ac.at 10 | * 11 | * Automation and Control Institute 12 | * Vienna University of Technology 13 | * Gusshausstraße 25-29 14 | * 1170 Vienn, Austria 15 | * 16 | * This program is free software: you can redistribute it and/or modify 17 | * it under the terms of the GNU General Public License as published by 18 | * the Free Software Foundation, either version 3 of the License, or 19 | * (at your option) any later version. 20 | * 21 | * This program is distributed in the hope that it will be useful, 22 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 23 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 24 | * GNU General Public License for more details. 25 | * 26 | * You should have received a copy of the GNU General Public License 27 | * along with this program. If not, see . 28 | * 29 | * @author Johann Prankl, Aitor Aldoma 30 | * 31 | */ 32 | 33 | #include "mainwindow.h" 34 | #include 35 | 36 | int main(int argc, char *argv[]) 37 | { 38 | QApplication a(argc, argv); 39 | MainWindow w; 40 | w.show(); 41 | 42 | return a.exec(); 43 | } 44 | -------------------------------------------------------------------------------- /apps/segmentation/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.6) 2 | SET(APPS_SEGMENTATION 1 CACHE BOOL "App to test segmentation" ) 3 | set(SUBSYS_DEPS v4r_segmentation v4r_io v4r_common) 4 | IF(APPS_SEGMENTATION) 5 | IF(V4R_SEGMENTATION) 6 | find_package (OpenCV) 7 | find_package(PCL REQUIRED ) 8 | find_package(Boost REQUIRED regex) 9 | 10 | link_directories(${PCL_LIBRARY_DIRS} ${Boost_LIBRARY_DIR}) 11 | add_definitions(${PCL_DEFINITIONS}) 12 | 13 | find_package(Eigen3 REQUIRED) 14 | 15 | include_directories(${EIGEN3_INCLUDE_DIRS} ${PCL_INCLUDE_DIRS} ${OpenCV_INCLUDE_DIRS}) 16 | 17 | add_executable(slicLabeling labelingSlic.cpp) 18 | target_link_libraries(slicLabeling ${OpenCV_LIBS} ${PCL_LIBRARIES} ${SUBSYS_DEPS} ${Boost_LIBRARIES}) 19 | 20 | ENDIF(V4R_SEGMENTATION) 21 | ENDIF(APPS_SEGMENTATION) 22 | -------------------------------------------------------------------------------- /cmake/V4RExtraTargets.cmake: -------------------------------------------------------------------------------- 1 | # ---------------------------------------------------------------------------- 2 | # Uninstall target, for "make uninstall" 3 | # ---------------------------------------------------------------------------- 4 | CONFIGURE_FILE( 5 | "${V4R_SOURCE_DIR}/cmake/templates/cmake_uninstall.cmake.in" 6 | "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" 7 | @ONLY) 8 | 9 | ADD_CUSTOM_TARGET(uninstall "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake") 10 | 11 | # ---------------------------------------------------------------------------- 12 | # target building all V4R modules 13 | # ---------------------------------------------------------------------------- 14 | add_custom_target(v4r_modules) 15 | if(ENABLE_SOLUTION_FOLDERS) 16 | set_target_properties(v4r_modules PROPERTIES FOLDER "extra") 17 | endif() 18 | 19 | # ---------------------------------------------------------------------------- 20 | # targets building all tests 21 | # ---------------------------------------------------------------------------- 22 | if(BUILD_TESTS) 23 | add_custom_target(v4r_tests) 24 | endif() 25 | if(BUILD_PERF_TESTS) 26 | add_custom_target(v4r_perf_tests) 27 | endif() 28 | -------------------------------------------------------------------------------- /cmake/V4RFindAssimp.cmake: -------------------------------------------------------------------------------- 1 | if(WITH_ASSIMP) 2 | find_path(ASSIMP_INCLUDE_PATH assimp/config.h 3 | PATHS /usr/local /opt /usr $ENV{ASSIMP_ROOT} 4 | DOC "The path to Assimp header files" 5 | CMAKE_FIND_ROOT_PATH_BOTH) 6 | find_library(ASSIMP_LIBRARIES 7 | NAMES assimp 8 | PATHS /usr/local /opt /usr $ENV{ASSIMP_ROOT} 9 | DOC "The Assimp library") 10 | if(ASSIMP_INCLUDE_PATH AND ASSIMP_LIBRARIES) 11 | set(ASSIMP_INCLUDE_DIRS "${ASSIMP_INCLUDE_PATH}") 12 | set(HAVE_ASSIMP YES) 13 | # Find version number in pkgconfig file 14 | find_file(ASSIMP_PKGCONFIG_FILE assimp.pc 15 | PATHS /usr/local /opt /usr $ENV{ASSIMP_ROOT} 16 | PATH_SUFFIXES lib/pkgconfig 17 | DOC "The Assimp pkfconfig file" 18 | CMAKE_FIND_ROOT_PATH_BOTH) 19 | if(ASSIMP_PKGCONFIG_FILE) 20 | file(STRINGS "${ASSIMP_PKGCONFIG_FILE}" _version REGEX "Version: [0-9.]+") 21 | if(_version) 22 | string(REGEX REPLACE "Version: " "" ASSIMP_VERSION ${_version}) 23 | endif() 24 | endif() 25 | endif() 26 | endif() 27 | -------------------------------------------------------------------------------- /cmake/V4RFindBoost.cmake: -------------------------------------------------------------------------------- 1 | if(WITH_BOOST) 2 | find_package(Boost "${MIN_VER_BOOST}" COMPONENTS thread program_options serialization system filesystem regex) 3 | if(Boost_FOUND) 4 | set(BOOST_LIBRARIES "${Boost_LIBRARIES}") 5 | set(BOOST_INCLUDE_DIRS "${Boost_INCLUDE_DIRS}") 6 | set(HAVE_BOOST TRUE) 7 | endif() 8 | endif() 9 | -------------------------------------------------------------------------------- /cmake/V4RFindCaffe.cmake: -------------------------------------------------------------------------------- 1 | if(WITH_CAFFE) 2 | find_package(Caffe) 3 | if(Caffe_FOUND) 4 | get_target_property(CAFFE_INCLUDE_DIRS caffe INTERFACE_INCLUDE_DIRECTORIES) 5 | set(CAFFE_LIBRARIES "${Caffe_LIBRARIES}") 6 | #get_target_property(CAFFE_DEFINITIONS caffe INTERFACE_COMPILE_DEFINITIONS) 7 | #add_definitions(${CAFFE_DEFINITIONS}) // Caffe library does not append "-D" for these definitions. Use for_each and prefix "-D" if needed! 8 | set(HAVE_CAFFE TRUE) 9 | endif() 10 | endif() 11 | -------------------------------------------------------------------------------- /cmake/V4RFindCeres.cmake: -------------------------------------------------------------------------------- 1 | if(WITH_CERES) 2 | if(BUILD_CERES) 3 | v4r_clear_vars(CERES_FOUND) 4 | endif() 5 | if(NOT CERES_FOUND) 6 | v4r_clear_vars(CERES_LIBRARY CERES_INCLUDE_DIRS CERES_VERSION) 7 | set(CERES_LIBRARY ceres) 8 | set(CERES_LIBRARIES ${CERES_LIBRARY}) 9 | add_subdirectory("${V4R_SOURCE_DIR}/3rdparty/ceres") 10 | set(CERES_INCLUDE_DIRS "${${CERES_LIBRARY}_INCLUDE_DIR}") 11 | set(CERES_VERSION "${${CERES_LIBRARY}_VERSION}") 12 | endif() 13 | set(HAVE_CERES YES) 14 | endif() 15 | -------------------------------------------------------------------------------- /cmake/V4RFindEDT.cmake: -------------------------------------------------------------------------------- 1 | if(WITH_EDT) 2 | if(BUILD_EDT) 3 | v4r_clear_vars(EDT_FOUND) 4 | endif() 5 | if(NOT EDT_FOUND) 6 | v4r_clear_vars(EDT_LIBRARY EDT_LIBRARIES EDT_INCLUDE_DIRS) 7 | set(EDT_LIBRARY edt) 8 | set(EDT_LIBRARIES ${EDT_LIBRARY}) 9 | add_subdirectory("${V4R_SOURCE_DIR}/3rdparty/EDT") 10 | set(EDT_INCLUDE_DIRS "${V4R_SOURCE_DIR}/3rdparty") 11 | #set(EDT_DEFINITIONS "") 12 | endif() 13 | set(HAVE_EDT YES) 14 | endif() 15 | -------------------------------------------------------------------------------- /cmake/V4RFindEigen.cmake: -------------------------------------------------------------------------------- 1 | if(WITH_EIGEN) 2 | v4r_clear_vars(EIGEN_INCLUDE_DIR EIGEN_WORLD_VERSION EIGEN_MAJOR_VERSION EIGEN_MINOR_VERSION EIGEN_LIBRARIES EIGEN_INCLUDE_DIRS) 3 | find_path(EIGEN_INCLUDE_PATH "Eigen/Core" 4 | PATHS /usr/local /opt /usr $ENV{EIGEN_ROOT}/include ENV ProgramFiles ENV ProgramW6432 5 | PATH_SUFFIXES include/eigen3 Eigen/include/eigen3 6 | DOC "The path to Eigen3 headers" 7 | CMAKE_FIND_ROOT_PATH_BOTH) 8 | if(EIGEN_INCLUDE_PATH) 9 | set(EIGEN_LIBRARIES "") 10 | set(EIGEN_INCLUDE_DIRS "${EIGEN_INCLUDE_PATH}") 11 | v4r_parse_header("${EIGEN_INCLUDE_PATH}/Eigen/src/Core/util/Macros.h" EIGEN_VERSION_LINES EIGEN_WORLD_VERSION EIGEN_MAJOR_VERSION EIGEN_MINOR_VERSION) 12 | set(HAVE_EIGEN TRUE) 13 | endif() 14 | endif() 15 | -------------------------------------------------------------------------------- /cmake/V4RFindGLM.cmake: -------------------------------------------------------------------------------- 1 | if(WITH_GLM) 2 | v4r_clear_vars(GLM_INCLUDE_PATH GLM_VERSION_MAJOR GLM_VERSION_MINOR GLM_VERSION_PATCH GLM_LIBRARIES GLM_VERSION GLM_INCLUDE_DIRS) 3 | find_path(GLM_INCLUDE_PATH "glm.hpp" 4 | PATHS /usr/local /opt /usr $ENV{GLM_ROOT} 5 | PATH_SUFFIXES include/glm glm 6 | DOC "The path to GLM headers" 7 | CMAKE_FIND_ROOT_PATH_BOTH) 8 | if(GLM_INCLUDE_PATH) 9 | set(GLM_LIBRARIES "") 10 | set(GLM_INCLUDE_DIRS "${GLM_INCLUDE_PATH}") 11 | v4r_parse_header("${GLM_INCLUDE_PATH}/detail/setup.hpp" GLM_VERSION_LINES GLM_VERSION_MAJOR GLM_VERSION_MINOR GLM_VERSION_PATCH) 12 | set(GLM_VERSION "${GLM_VERSION_MAJOR}.${GLM_VERSION_MINOR}.${GLM_VERSION_PATCH}") 13 | set(HAVE_GLM TRUE) 14 | endif() 15 | endif() 16 | -------------------------------------------------------------------------------- /cmake/V4RFindGTest.cmake: -------------------------------------------------------------------------------- 1 | if(BUILD_GTEST) 2 | v4r_clear_vars(GTEST_FOUND) 3 | else() 4 | message(WARNING "GTest is required, but building it from source is disabled. " 5 | "This option is not implemented, so you will need to write rules " 6 | "to find system-wide installation of GTest yourself.") 7 | endif() 8 | if(NOT GTEST_FOUND) 9 | add_subdirectory("${V4R_SOURCE_DIR}/3rdparty/gtest") 10 | endif() 11 | set(HAVE_GTEST YES) 12 | -------------------------------------------------------------------------------- /cmake/V4RFindGlew.cmake: -------------------------------------------------------------------------------- 1 | if(WITH_GLEW) 2 | find_package(GLEW) 3 | if(GLEW_FOUND) 4 | set(GLEW_LIBRARIES "${GLEW_LIBRARIES}") 5 | set(GLEW_INCLUDE_DIRS "${GLEW_INCLUDE_DIR}") 6 | set(HAVE_GLEW TRUE) 7 | endif() 8 | endif() 9 | -------------------------------------------------------------------------------- /cmake/V4RFindLIBSVM.cmake: -------------------------------------------------------------------------------- 1 | if(WITH_LIBSVM) 2 | if(BUILD_LIBSVM) 3 | v4r_clear_vars(LIBSVM_FOUND) 4 | else() 5 | find_path(LIBSVM_INCLUDE_PATH libsvm/svm.h 6 | PATHS /usr/local /opt /usr $ENV{LIBSVM_ROOT} 7 | DOC "The path to LibSVM header" 8 | CMAKE_FIND_ROOT_PATH_BOTH) 9 | find_library(LIBSVM_LIBRARIES 10 | NAMES svm 11 | PATHS /usr/local /opt /usr $ENV{LIBSVM_ROOT} 12 | DOC "The LibSVM library") 13 | if(LIBSVM_INCLUDE_PATH AND LIBSVM_LIBRARIES) 14 | set(LIBSVM_INCLUDE_DIRS "${LIBSVM_INCLUDE_PATH}") 15 | v4r_parse_header("${LIBSVM_INCLUDE_PATH}/libsvm/svm.h" LIBSVM_VERSION_LINES LIBSVM_VERSION) 16 | set(LIBSVM_FOUND YES) 17 | endif() 18 | endif() 19 | if(NOT LIBSVM_FOUND) 20 | v4r_clear_vars(LIBSVM_LIBRARY LIBSVM_INCLUDE_DIRS LIBSVM_VERSION) 21 | set(LIBSVM_LIBRARY libsvm) 22 | set(LIBSVM_LIBRARIES ${LIBSVM_LIBRARY}) 23 | add_subdirectory("${V4R_SOURCE_DIR}/3rdparty/libsvm") 24 | set(LIBSVM_INCLUDE_DIRS "${V4R_SOURCE_DIR}/3rdparty") 25 | set(LIBSVM_VERSION "3.20") # TODO 26 | endif() 27 | set(HAVE_LIBSVM YES) 28 | endif() 29 | -------------------------------------------------------------------------------- /cmake/V4RFindLibsPerf.cmake: -------------------------------------------------------------------------------- 1 | # ---------------------------------------------------------------------------- 2 | # Detect other 3rd-party performance and math libraries 3 | # ---------------------------------------------------------------------------- 4 | 5 | # --- CUDA --- 6 | if(WITH_CUDA) 7 | include("${V4R_SOURCE_DIR}/cmake/V4RDetectCUDA.cmake") 8 | endif(WITH_CUDA) 9 | 10 | # --- Eigen --- 11 | if(WITH_EIGEN) 12 | find_path(EIGEN_INCLUDE_PATH "Eigen/Core" 13 | PATHS /usr/local /opt /usr ENV ProgramFiles ENV ProgramW6432 14 | PATH_SUFFIXES include/eigen3 include/eigen2 Eigen/include/eigen3 Eigen/include/eigen2 15 | DOC "The path to Eigen3/Eigen2 headers" 16 | CMAKE_FIND_ROOT_PATH_BOTH) 17 | 18 | if(EIGEN_INCLUDE_PATH) 19 | v4r_include_directories(${EIGEN_INCLUDE_PATH}) 20 | v4r_parse_header("${EIGEN_INCLUDE_PATH}/Eigen/src/Core/util/Macros.h" EIGEN_VERSION_LINES EIGEN_WORLD_VERSION EIGEN_MAJOR_VERSION EIGEN_MINOR_VERSION) 21 | set(HAVE_EIGEN 1) 22 | endif() 23 | endif(WITH_EIGEN) 24 | 25 | # --- OpenMP --- 26 | #if(WITH_OPENMP AND NOT HAVE_TBB AND NOT HAVE_CSTRIPES) 27 | if(WITH_OPENMP) 28 | find_package(OpenMP) 29 | if(OPENMP_FOUND) 30 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}") 31 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}") 32 | endif() 33 | set(HAVE_OPENMP "${OPENMP_FOUND}") 34 | endif() 35 | 36 | -------------------------------------------------------------------------------- /cmake/V4RFindMETSlib.cmake: -------------------------------------------------------------------------------- 1 | if(WITH_METSLIB) 2 | if(BUILD_METSLIB) 3 | v4r_clear_vars(METSLIB_FOUND) 4 | else() 5 | message(WARNING "METSlib support is enabled, but building from source is disabled. " 6 | "This option is not implemented, so you will need to write rules to " 7 | "find system-wide installation of METSlib yourself.") 8 | endif() 9 | if(NOT METSLIB_FOUND) 10 | v4r_clear_vars(METSLIB_LIBRARY METSLIB_INCLUDE_DIRS METSLIB_VERSION) 11 | set(METSLIB_LIBRARY metslib) 12 | add_subdirectory("${V4R_SOURCE_DIR}/3rdparty/metslib") 13 | set(METSLIB_LIBRARIES "") 14 | set(METSLIB_INCLUDE_DIRS "${${METSLIB_LIBRARY}_INCLUDE_DIR}") 15 | set(METSLIB_VERSION "${${METSLIB_LIBRARY}_VERSION}") 16 | set(HAVE_METSLIB YES) 17 | endif() 18 | endif() 19 | -------------------------------------------------------------------------------- /cmake/V4RFindON_NURBS.cmake: -------------------------------------------------------------------------------- 1 | if(WITH_ON_NURBS) 2 | if(BUILD_ON_NURBS) 3 | v4r_clear_vars(ON_NURBS_FOUND) 4 | endif() 5 | if(NOT ON_NURBS_FOUND) 6 | v4r_clear_vars(ON_NURBS_LIBRARY ON_NURBS_INCLUDE_DIRS ON_NURBS_VERSION) 7 | set(ON_NURBS_LIBRARY on_nurbs) 8 | Set(ON_NURBS_LIBRARIES ${ON_NURBS_LIBRARY}) 9 | add_subdirectory("${V4R_SOURCE_DIR}/3rdparty/on_nurbs") 10 | set(ON_NURBS_INCLUDE_DIRS "${V4R_SOURCE_DIR}/3rdparty") 11 | set(ON_NURBS_VERSION "1.0") # TODO 12 | endif() 13 | set(HAVE_ON_NURBS YES) 14 | endif() 15 | -------------------------------------------------------------------------------- /cmake/V4RFindOpenCV.cmake: -------------------------------------------------------------------------------- 1 | if(WITH_OPENCV) 2 | if(MIN_VER_OpenCV) 3 | find_package(OpenCV "${MIN_VER_OpenCV}") 4 | else() 5 | find_package(OpenCV) 6 | endif() 7 | if(OpenCV_FOUND) 8 | set(OPENCV_LIBRARIES "${OpenCV_LIBS}") 9 | set(OPENCV_INCLUDE_DIRS "${OpenCV_INCLUDE_DIRS}") 10 | set(HAVE_OPENCV TRUE) 11 | endif() 12 | endif() 13 | -------------------------------------------------------------------------------- /cmake/V4RFindOpenGL.cmake: -------------------------------------------------------------------------------- 1 | if(WITH_OPENGL) 2 | find_package(OpenGL) 3 | if(OPENGL_FOUND) 4 | set(OPENGL_LIBRARIES "${OPENGL_LIBRARIES}") 5 | set(OPENGL_INCLUDE_DIRS "${OPENGL_INCLUDE_DIR}") 6 | set(HAVE_OPENGL TRUE) 7 | endif() 8 | endif() 9 | -------------------------------------------------------------------------------- /cmake/V4RFindOpenNI2.cmake: -------------------------------------------------------------------------------- 1 | if(WITH_OPENNI2) 2 | pkg_check_modules(OPENNI2 REQUIRED libopenni2) 3 | if(${OPENNI2_FOUND}) 4 | set(OPENNI2_LIBRARIES "${OPENNI2_LIBRARY}") 5 | set(OPENNI2_INCLUDE_DIRS "${OPENNI2_INCLUDE_DIR}") 6 | set(HAVE_OPENNI2 TRUE) 7 | endif() 8 | endif() 9 | -------------------------------------------------------------------------------- /cmake/V4RFindOpenNURBS.cmake: -------------------------------------------------------------------------------- 1 | if(WITH_OPENNURBS) 2 | if(BUILD_OPENNURBS) 3 | v4r_clear_vars(OPENNURBS_FOUND) 4 | endif() 5 | if(NOT OPENNURBS_FOUND) 6 | v4r_clear_vars(OPENNURBS_LIBRARY OPENNURBS_INCLUDE_DIRS OPENNURBS_VERSION) 7 | set(OPENNURBS_LIBRARY opennurbs) 8 | Set(OPENNURBS_LIBRARIES ${OPENNURBS_LIBRARY}) 9 | add_subdirectory("${V4R_SOURCE_DIR}/3rdparty/opennurbs") 10 | set(OPENNURBS_INCLUDE_DIRS "${V4R_SOURCE_DIR}/3rdparty") 11 | set(OPENNURBS_VERSION "1.0") # TODO 12 | endif() 13 | set(HAVE_OPENNURBS YES) 14 | endif() 15 | -------------------------------------------------------------------------------- /cmake/V4RFindPCL.cmake: -------------------------------------------------------------------------------- 1 | if(WITH_PCL) 2 | find_package(PCL "${MIN_VER_PCL}") 3 | list(REMOVE_ITEM PCL_LIBRARIES "vtkproj4") 4 | if(PCL_FOUND) 5 | set(HAVE_PCL TRUE) 6 | endif() 7 | endif() 8 | -------------------------------------------------------------------------------- /cmake/V4RFindPCL_1_8.cmake: -------------------------------------------------------------------------------- 1 | v4r_clear_vars(PCL_1_8_FOUND) 2 | if(NOT PCL_1_8_FOUND) 3 | v4r_clear_vars(PCL_1_8_LIBRARY PCL_1_8_LIBRARIES PCL_1_8_INCLUDE_DIRS) 4 | set(PCL_1_8_LIBRARY pcl_1_8) 5 | add_subdirectory("${V4R_SOURCE_DIR}/3rdparty/pcl_1_8") 6 | set(PCL_1_8_INCLUDE_DIRS "${V4R_SOURCE_DIR}/3rdparty/pcl_1_8") 7 | endif() 8 | 9 | -------------------------------------------------------------------------------- /cmake/V4RFindQt.cmake: -------------------------------------------------------------------------------- 1 | if(WITH_QT) 2 | if(WITH_QT4) 3 | find_package(Qt4 ) 4 | if(Qt4_FOUND) 5 | set(QT4_LIBRARIES "${QT_LIBRARIES}") 6 | set(QT4_INCLUDE_DIRS "${QT_INCLUDE_DIR} ${QT_INCLUDE_DIR}/QtOpenGL") 7 | set(HAVE_QT4 TRUE) 8 | else() 9 | message(FATAL_ERROR "Could not find Qt4 libraries! You should install the libraries or turn off Qt completely by disabling WITH_QT") 10 | endif() 11 | else() 12 | find_package(Qt5 REQUIRED Core OpenGL Widgets) 13 | if(Qt5Core_FOUND) 14 | set(HAVE_QT TRUE) 15 | set(HAVE_QT_OPENGL TRUE) 16 | set(HAVE_QT5 TRUE) 17 | 18 | else() 19 | message(FATAL_ERROR "Could not find Qt5 libraries! Either install the libraries, or enable WITH_QT4 instead, or turn off Qt completely by disabling WITH_QT") 20 | endif() 21 | 22 | endif() 23 | endif() 24 | 25 | -------------------------------------------------------------------------------- /cmake/V4RFindSiftGPU.cmake: -------------------------------------------------------------------------------- 1 | if(WITH_SIFTGPU) 2 | if(BUILD_SIFTGPU) 3 | v4r_clear_vars(SIFTGPU_FOUND) 4 | else() 5 | message(WARNING "SiftGPU support is enabled, but building from source is disabled. " 6 | "This option is not implemented, so you will need to write rules to " 7 | "find system-wide installation of SiftGPU yourself.") 8 | endif() 9 | if(NOT SIFTGPU_FOUND) 10 | v4r_clear_vars(SIFTGPU_LIBRARY SIFTGPU_INCLUDE_DIRS) 11 | set(SIFTGPU_LIBRARY siftgpu) 12 | set(SIFTGPU_LIBRARIES ${SIFTGPU_LIBRARY} GLEW IL) # TODO: search for GLEW/IL/etc explicitly in cmakelists 13 | add_subdirectory("${V4R_SOURCE_DIR}/3rdparty/SiftGPU") 14 | set(SIFTGPU_INCLUDE_DIRS "${${SIFTGPU_LIBRARY}_SOURCE_DIR}/src") 15 | endif() 16 | set(SIFTGPU_VERSION "v400") # TODO 17 | set(HAVE_SIFTGPU YES) 18 | endif() 19 | -------------------------------------------------------------------------------- /cmake/V4RFindX11.cmake: -------------------------------------------------------------------------------- 1 | if(WITH_X11) 2 | find_package(X11) 3 | if(X11_FOUND) 4 | set(X11_LIBRARIES "${X11_LIBRARIES}") 5 | set(X11_INCLUDE_DIRS "${X11_INCLUDE_DIR}") 6 | set(HAVE_X11 TRUE) 7 | endif() 8 | endif() 9 | -------------------------------------------------------------------------------- /cmake/V4RFindXRandR.cmake: -------------------------------------------------------------------------------- 1 | #if(WITH_XRANDR) 2 | # find_package(XRANDR) 3 | # if(XRANDR_FOUND) 4 | # message("********ASDFSAFSAFSDAFSDAF***********") 5 | # set(XRANDR_LIBRARIES "${XRandr_LIBRARIES}") 6 | # set(XRANDR_INCLUDE_DIRS "${XRandr_INCLUDE_DIR}") 7 | # set(HAVE_XRANDR TRUE) 8 | # endif() 9 | #endif() 10 | -------------------------------------------------------------------------------- /cmake/V4RGenHeaders.cmake: -------------------------------------------------------------------------------- 1 | # platform-specific config file 2 | configure_file("${V4R_SOURCE_DIR}/cmake/templates/v4r_config.h.in" "${V4R_CONFIG_FILE_INCLUDE_DIR}/v4r_config.h") 3 | install(FILES "${V4R_CONFIG_FILE_INCLUDE_DIR}/v4r_config.h" DESTINATION ${V4R_INCLUDE_INSTALL_PATH} COMPONENT dev) 4 | 5 | # ---------------------------------------------------------------------------- 6 | # v4r_modules.h based on actual modules list 7 | # ---------------------------------------------------------------------------- 8 | set(V4R_MODULE_DEFINITIONS_CONFIGMAKE "") 9 | 10 | set(V4R_MOD_LIST ${V4R_MODULES_PUBLIC}) 11 | v4r_list_sort(V4R_MOD_LIST) 12 | foreach(m ${V4R_MOD_LIST}) 13 | string(TOUPPER "${m}" m) 14 | set(V4R_MODULE_DEFINITIONS_CONFIGMAKE "${V4R_MODULE_DEFINITIONS_CONFIGMAKE}#define HAVE_${m}\n") 15 | endforeach() 16 | 17 | set(V4R_MODULE_DEFINITIONS_CONFIGMAKE "${V4R_MODULE_DEFINITIONS_CONFIGMAKE}\n") 18 | 19 | configure_file("${V4R_SOURCE_DIR}/cmake/templates/v4r_modules.h.in" "${V4R_CONFIG_FILE_INCLUDE_DIR}/v4r_modules.h") 20 | install(FILES "${V4R_CONFIG_FILE_INCLUDE_DIR}/v4r_modules.h" DESTINATION ${V4R_INCLUDE_INSTALL_PATH} COMPONENT dev) 21 | -------------------------------------------------------------------------------- /cmake/V4RMinDepVersions.cmake: -------------------------------------------------------------------------------- 1 | set(MIN_VER_CMAKE 2.8.7) 2 | #set(MIN_VER_OpenCV 2.4) 3 | #set(MIN_VER_OpenCV 3.1) 4 | set(MIN_VER_PCL 1.7.1) 5 | set(MIN_VER_BOOST 1.48) # random guess 6 | -------------------------------------------------------------------------------- /cmake/V4RVersion.cmake: -------------------------------------------------------------------------------- 1 | set(V4R_VERSION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/modules/core/include/v4r/core/version.h") 2 | file(STRINGS "${V4R_VERSION_FILE}" V4R_VERSION_PARTS REGEX "#define V4R_VERSION_[A-Z]+[ ]+" ) 3 | 4 | string(REGEX REPLACE ".+V4R_VERSION_MAJOR[ ]+([0-9]+).*" "\\1" V4R_VERSION_MAJOR "${V4R_VERSION_PARTS}") 5 | string(REGEX REPLACE ".+V4R_VERSION_MINOR[ ]+([0-9]+).*" "\\1" V4R_VERSION_MINOR "${V4R_VERSION_PARTS}") 6 | string(REGEX REPLACE ".+V4R_VERSION_REVISION[ ]+([0-9]+).*" "\\1" V4R_VERSION_PATCH "${V4R_VERSION_PARTS}") 7 | string(REGEX REPLACE ".+V4R_VERSION_STATUS[ ]+\"([^\"]*)\".*" "\\1" V4R_VERSION_STATUS "${V4R_VERSION_PARTS}") 8 | 9 | set(V4R_VERSION_PLAIN "${V4R_VERSION_MAJOR}.${V4R_VERSION_MINOR}.${V4R_VERSION_PATCH}") 10 | 11 | set(V4R_VERSION "${V4R_VERSION_PLAIN}${V4R_VERSION_STATUS}") 12 | 13 | set(V4R_SOVERSION "${V4R_VERSION_MAJOR}.${V4R_VERSION_MINOR}") 14 | set(V4R_LIBVERSION "${V4R_VERSION_MAJOR}.${V4R_VERSION_MINOR}.${V4R_VERSION_PATCH}") 15 | 16 | # create a dependency on version file 17 | # we never use output of the following command but cmake will rerun automatically if the version file changes 18 | configure_file("${V4R_VERSION_FILE}" "${CMAKE_BINARY_DIR}/junk/version.junk" COPYONLY) 19 | -------------------------------------------------------------------------------- /cmake/templates/V4RConfig-version.cmake.in: -------------------------------------------------------------------------------- 1 | set(V4R_VERSION @V4R_VERSION_PLAIN@) 2 | set(PACKAGE_VERSION ${V4R_VERSION}) 3 | 4 | set(PACKAGE_VERSION_EXACT False) 5 | set(PACKAGE_VERSION_COMPATIBLE False) 6 | 7 | if(PACKAGE_FIND_VERSION VERSION_EQUAL PACKAGE_VERSION) 8 | set(PACKAGE_VERSION_EXACT True) 9 | set(PACKAGE_VERSION_COMPATIBLE True) 10 | endif() 11 | 12 | if(PACKAGE_FIND_VERSION VERSION_LESS PACKAGE_VERSION) 13 | set(PACKAGE_VERSION_COMPATIBLE True) 14 | endif() 15 | -------------------------------------------------------------------------------- /cmake/templates/cmake_uninstall.cmake.in: -------------------------------------------------------------------------------- 1 | # ----------------------------------------------- 2 | # File that provides "make uninstall" target 3 | # We use the file 'install_manifest.txt' 4 | # ----------------------------------------------- 5 | IF(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") 6 | MESSAGE(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt\"") 7 | ENDIF(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") 8 | 9 | FILE(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files) 10 | STRING(REGEX REPLACE "\n" ";" files "${files}") 11 | FOREACH(file ${files}) 12 | MESSAGE(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"") 13 | IF(EXISTS "$ENV{DESTDIR}${file}") 14 | EXEC_PROGRAM( 15 | "@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\"" 16 | OUTPUT_VARIABLE rm_out 17 | RETURN_VALUE rm_retval 18 | ) 19 | IF(NOT "${rm_retval}" STREQUAL 0) 20 | MESSAGE(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"") 21 | ENDIF(NOT "${rm_retval}" STREQUAL 0) 22 | ELSE(EXISTS "$ENV{DESTDIR}${file}") 23 | MESSAGE(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.") 24 | ENDIF(EXISTS "$ENV{DESTDIR}${file}") 25 | ENDFOREACH(file) 26 | -------------------------------------------------------------------------------- /cmake/templates/v4r_config.h.in: -------------------------------------------------------------------------------- 1 | /* V4R compiled as static or dynamic libs */ 2 | #cmakedefine BUILD_SHARED_LIBS 3 | 4 | /* Compile for 'real' NVIDIA GPU architectures */ 5 | #define CUDA_ARCH_BIN "${V4R_CUDA_ARCH_BIN}" 6 | 7 | /* Create PTX or BIN for 1.0 compute capability */ 8 | #cmakedefine CUDA_ARCH_BIN_OR_PTX_10 9 | 10 | /* NVIDIA GPU features are used */ 11 | #define CUDA_ARCH_FEATURES "${V4R_CUDA_ARCH_FEATURES}" 12 | 13 | /* Compile for 'virtual' NVIDIA PTX architectures */ 14 | #define CUDA_ARCH_PTX "${V4R_CUDA_ARCH_PTX}" 15 | 16 | /* C= */ 17 | #cmakedefine HAVE_CSTRIPES 18 | 19 | /* NVidia Cuda Runtime API*/ 20 | #cmakedefine HAVE_CUDA 21 | 22 | /* Eigen Matrix & Linear Algebra Library */ 23 | #cmakedefine HAVE_EIGEN 24 | 25 | /* Define to 1 if you have the header file. */ 26 | #cmakedefine HAVE_INTTYPES_H 1 27 | 28 | /* OpenCL Support */ 29 | #cmakedefine HAVE_OPENCL 30 | #cmakedefine HAVE_OPENCL_STATIC 31 | 32 | /* OpenGL support*/ 33 | #cmakedefine HAVE_OPENGL 34 | 35 | /* OpenNI library */ 36 | #cmakedefine HAVE_OPENNI 37 | 38 | /* OpenNI library */ 39 | #cmakedefine HAVE_OPENNI2 40 | 41 | /* Posix threads (pthreads) */ 42 | #cmakedefine HAVE_PTHREADS 43 | 44 | /* parallel_for with pthreads */ 45 | #cmakedefine HAVE_PTHREADS_PF 46 | 47 | /* Qt support */ 48 | #cmakedefine HAVE_QT 49 | 50 | /* Qt OpenGL support */ 51 | #cmakedefine HAVE_QT_OPENGL 52 | 53 | /* Intel Threading Building Blocks */ 54 | #cmakedefine HAVE_TBB 55 | 56 | /* Define if your processor stores words with the most significant byte 57 | first (like Motorola and SPARC, unlike Intel and VAX). */ 58 | #cmakedefine WORDS_BIGENDIAN 59 | 60 | #cmakedefine HAVE_SIFTGPU 61 | #cmakedefine HAVE_LIBSVM 62 | #cmakedefine HAVE_METSLIB 63 | #cmakedefine HAVE_PCL 64 | #cmakedefine HAVE_OPENCV 65 | #cmakedefine HAVE_CERES 66 | #cmakedefine HAVE_ASSIMP 67 | #cmakedefine HAVE_CAFFE 68 | 69 | 70 | -------------------------------------------------------------------------------- /cmake/templates/v4r_modules.h.in: -------------------------------------------------------------------------------- 1 | /* 2 | * ** File generated automatically, do not modify ** 3 | * 4 | * This file defines the list of modules available in current build configuration 5 | * 6 | * 7 | */ 8 | 9 | @V4R_MODULE_DEFINITIONS_CONFIGMAKE@ 10 | -------------------------------------------------------------------------------- /data/.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strands-project/v4r/7cb817e05cb9d99cb2f68db009c27d7144d07f09/data/.gitignore -------------------------------------------------------------------------------- /docs/IMKRecognizer.md: -------------------------------------------------------------------------------- 1 | # Keypoint based Object Recognition in Monocular Images 2 | 3 | IMKRecognizer is able to recognize objects in monocular images and to estimate the pose using a pnp-method. Object models, i.e. a sequence of RGBD-keyframes, the corresponding poses and the an object mask, can be created with RTMT, which supports OpenNI-Cameras (ASUS, Kinect). 4 | 5 | 6 | ## Usage 7 | For object recognition the model directory with the object-data stored in sub-directories need to be provided. For a RGBD-keyframe this can look like: “data/models/objectname1/views/frame_xxxx.pcd”. 8 | If the recognizer is started the first time the keyframes are loaded, interest points are detected, clustered and stored in a concatenated 'imk_objectname1_objectname2.bin' file. In case any recognition parameter is changed this file must be deleted and it will be created newly next time. 9 | 10 | ``` 11 | bin/example-imkRecognizeObject-file --help 12 | bin/example-imkRecognizeObject-file -d data/models/ -n objectname1 objectname2 ... -f ~/testimages/image_%04d.jpg -s 0 -e 5 -t 0.5 13 | ``` 14 | 15 | ## References 16 | * J. Prankl, T. Mörwald, M. Zillich, M. Vincze: "Probabilistic Cue Integration for Real-time Object Pose Tracking"; in: Proceedings of the 9th International Conference on Computer Vision Systems, (2013), 10 S. 17 | -------------------------------------------------------------------------------- /docs/images/object-modeling-01.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strands-project/v4r/7cb817e05cb9d99cb2f68db009c27d7144d07f09/docs/images/object-modeling-01.jpg -------------------------------------------------------------------------------- /docs/images/object-modeling-01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strands-project/v4r/7cb817e05cb9d99cb2f68db009c27d7144d07f09/docs/images/object-modeling-01.png -------------------------------------------------------------------------------- /docs/images/object-modeling-02.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strands-project/v4r/7cb817e05cb9d99cb2f68db009c27d7144d07f09/docs/images/object-modeling-02.jpg -------------------------------------------------------------------------------- /docs/images/object-modeling-03.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strands-project/v4r/7cb817e05cb9d99cb2f68db009c27d7144d07f09/docs/images/object-modeling-03.jpg -------------------------------------------------------------------------------- /docs/images/object-modeling-04.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strands-project/v4r/7cb817e05cb9d99cb2f68db009c27d7144d07f09/docs/images/object-modeling-04.jpg -------------------------------------------------------------------------------- /docs/images/object-modeling-05.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strands-project/v4r/7cb817e05cb9d99cb2f68db009c27d7144d07f09/docs/images/object-modeling-05.jpg -------------------------------------------------------------------------------- /docs/images/object-modeling-06.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strands-project/v4r/7cb817e05cb9d99cb2f68db009c27d7144d07f09/docs/images/object-modeling-06.jpg -------------------------------------------------------------------------------- /docs/images/object-modeling-07.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strands-project/v4r/7cb817e05cb9d99cb2f68db009c27d7144d07f09/docs/images/object-modeling-07.jpg -------------------------------------------------------------------------------- /docs/images/object-modeling-08.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strands-project/v4r/7cb817e05cb9d99cb2f68db009c27d7144d07f09/docs/images/object-modeling-08.jpg -------------------------------------------------------------------------------- /docs/images/object-modeling-09.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strands-project/v4r/7cb817e05cb9d99cb2f68db009c27d7144d07f09/docs/images/object-modeling-09.jpg -------------------------------------------------------------------------------- /docs/images/object-recognition-01.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strands-project/v4r/7cb817e05cb9d99cb2f68db009c27d7144d07f09/docs/images/object-recognition-01.jpg -------------------------------------------------------------------------------- /docs/images/object-texturing-01.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strands-project/v4r/7cb817e05cb9d99cb2f68db009c27d7144d07f09/docs/images/object-texturing-01.jpg -------------------------------------------------------------------------------- /docs/images/object-tracking-01.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strands-project/v4r/7cb817e05cb9d99cb2f68db009c27d7144d07f09/docs/images/object-tracking-01.jpg -------------------------------------------------------------------------------- /modules/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_definitions(-D__V4R_BUILD=1) 2 | 3 | if(NOT V4R_MODULES_PATH) 4 | set(V4R_MODULES_PATH "${CMAKE_CURRENT_SOURCE_DIR}") 5 | endif() 6 | 7 | v4r_glob_modules(${V4R_MODULES_PATH} EXTRA ${V4R_EXTRA_MODULES_PATH}) 8 | -------------------------------------------------------------------------------- /modules/apps/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(the_description "Application Libraries") 2 | v4r_define_module(apps REQUIRED v4r_core v4r_common v4r_features v4r_recognition v4r_keypoints v4r_io v4r_registration v4r_change_detection pcl pcl_1_8 opencv OPTIONAL caffe) 3 | 4 | -------------------------------------------------------------------------------- /modules/attention_segmentation/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(the_description "Attention-based Segmentation") 2 | v4r_include_directories(${OPENNURBS_INCLUDE_DIRS}) 3 | v4r_define_module(attention_segmentation REQUIRED v4r_core v4r_common v4r_io pcl opencv opennurbs on_nurbs) 4 | -------------------------------------------------------------------------------- /modules/attention_segmentation/include/v4r/attention_segmentation/AttentionModuleErrors.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2012 3 | * Ekaterina Potapova 4 | * Automation and Control Institute 5 | * Vienna University of Technology 6 | * Gusshausstraße 25-29 7 | * 1040 Vienna, Austria 8 | * potapova(at)acin.tuwien.ac.at 9 | * 10 | * This program is free software: you can redistribute it and/or modify 11 | * it under the terms of the GNU General Public License as published by 12 | * the Free Software Foundation, either version 3 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * GNU General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU General Public License 21 | * along with this program. If not, see http://www.gnu.org/licenses/ 22 | */ 23 | 24 | 25 | #ifndef AM_ERRORS_HPP 26 | #define AM_ERRORS_HPP 27 | 28 | namespace v4r 29 | { 30 | 31 | enum AttentionModuleErrors 32 | { 33 | AM_OK = 0, 34 | AM_POINTCLOUD = 1, 35 | AM_IMAGE, 36 | AM_PLANECOEFFICIENTS, 37 | AM_CAMERAPARAMETRS, 38 | AM_NORMALCLOUD, 39 | AM_DIFFERENTSIZES, 40 | AM_NORMALCOEFFICIENTS, 41 | AM_CURVATURECLOUD, 42 | AM_ZEROSIZE, 43 | AM_PARAMETERS, 44 | AM_DEPTH, 45 | AM_CUSTOM, 46 | }; 47 | 48 | enum CombinationTypeEnum 49 | { 50 | AM_COMB_SUM = 0, 51 | AM_COMB_MUL = 1, 52 | AM_COMB_MAX, 53 | }; 54 | 55 | } //namespace v4r 56 | 57 | #endif // AM_ERRORS_HPP 58 | -------------------------------------------------------------------------------- /modules/attention_segmentation/include/v4r/attention_segmentation/EPEvaluation.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2012 3 | * Ekaterina Potapova 4 | * Automation and Control Institute 5 | * Vienna University of Technology 6 | * Gusshausstraße 25-29 7 | * 1040 Vienna, Austria 8 | * potapova(at)acin.tuwien.ac.at 9 | * 10 | * This program is free software: you can redistribute it and/or modify 11 | * it under the terms of the GNU General Public License as published by 12 | * the Free Software Foundation, either version 3 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * GNU General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU General Public License 21 | * along with this program. If not, see http://www.gnu.org/licenses/ 22 | */ 23 | 24 | 25 | #ifndef EPEVALUATION_INCLUDE_HEADERS_HPP 26 | #define EPEVALUATION_INCLUDE_HEADERS_HPP 27 | 28 | #include "v4r/attention_segmentation/HitRatio.h" 29 | #include "v4r/attention_segmentation/segmentEvaluation.h" 30 | 31 | #endif //EPEVALUATION_INCLUDE_HEADERS_HPP 32 | -------------------------------------------------------------------------------- /modules/attention_segmentation/include/v4r/attention_segmentation/EPUtils.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2012 3 | * Ekaterina Potapova 4 | * Automation and Control Institute 5 | * Vienna University of Technology 6 | * Gusshausstraße 25-29 7 | * 1040 Vienna, Austria 8 | * potapova(at)acin.tuwien.ac.at 9 | * 10 | * This program is free software: you can redistribute it and/or modify 11 | * it under the terms of the GNU General Public License as published by 12 | * the Free Software Foundation, either version 3 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * GNU General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU General Public License 21 | * along with this program. If not, see http://www.gnu.org/licenses/ 22 | */ 23 | 24 | 25 | #ifndef EPUTILS_INCLUDE_HEADERS_HPP 26 | #define EPUTILS_INCLUDE_HEADERS_HPP 27 | 28 | #include "v4r/attention_segmentation/algo.h" 29 | #include "v4r/attention_segmentation/convertions.h" 30 | #include "v4r/attention_segmentation/normalization.h" 31 | #include "v4r/attention_segmentation/utils.h" 32 | //#include "v4r/attention_segmentation/sphereHistogram.h" 33 | #include "v4r/attention_segmentation/math.h" 34 | #include "v4r/attention_segmentation/drawUtils.h" 35 | //#include "v4r/attention_segmentation/debugUtils.h" 36 | #include "v4r/attention_segmentation/connectedComponents.h" 37 | #include "v4r/attention_segmentation/timeUtils.h" 38 | #ifndef NOT_USE_PCL 39 | #include "v4r/attention_segmentation/PCLPreprocessingXYZRC.h" 40 | #include "v4r/attention_segmentation/PCA.h" 41 | #endif 42 | 43 | #endif //EPUTILS_INCLUDE_HEADERS_HPP 44 | -------------------------------------------------------------------------------- /modules/attention_segmentation/include/v4r/attention_segmentation/Edge.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2012 3 | * Andreas Richtsfeld, Johann Prankl, Thomas Mörwald 4 | * Automation and Control Institute 5 | * Vienna University of Technology 6 | * Gusshausstraße 25-29 7 | * 1170 Vienn, Austria 8 | * ari(at)acin.tuwien.ac.at 9 | * 10 | * This program is free software: you can redistribute it and/or modify 11 | * it under the terms of the GNU General Public License as published by 12 | * the Free Software Foundation, either version 3 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * GNU General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU General Public License 21 | * along with this program. If not, see http://www.gnu.org/licenses/ 22 | */ 23 | 24 | /** 25 | * @file Edge.h 26 | * @author Andreas Richtsfeld 27 | * @date July 2011 28 | * @version 0.1 29 | * @brief Edge definitions for the graph. 30 | */ 31 | 32 | #ifndef GC_EDGE_H 33 | #define GC_EDGE_H 34 | 35 | namespace gc 36 | { 37 | 38 | struct Edge 39 | { 40 | int type; /// type of node 41 | float w; /// weightning factor 42 | float w2; /// optional second weightning factor 43 | int a, b; /// node numbers 44 | }; 45 | 46 | } 47 | 48 | #endif 49 | 50 | -------------------------------------------------------------------------------- /modules/attention_segmentation/include/v4r/attention_segmentation/MSR.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2012 3 | * Ekaterina Potapova 4 | * Automation and Control Institute 5 | * Vienna University of Technology 6 | * Gusshausstraße 25-29 7 | * 1040 Vienna, Austria 8 | * potapova(at)acin.tuwien.ac.at 9 | * 10 | * This program is free software: you can redistribute it and/or modify 11 | * it under the terms of the GNU General Public License as published by 12 | * the Free Software Foundation, either version 3 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * GNU General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU General Public License 21 | * along with this program. If not, see http://www.gnu.org/licenses/ 22 | */ 23 | 24 | 25 | #ifndef MSR_HPP 26 | #define MSR_HPP 27 | 28 | #include "v4r/attention_segmentation/headers.h" 29 | #include 30 | 31 | namespace v4r 32 | { 33 | 34 | struct MRSParams { 35 | float th; 36 | int mapLevel; 37 | bool useMorphologyOpenning; 38 | }; 39 | 40 | void V4R_EXPORTS defaultParamsMSR(MRSParams ¶ms); 41 | void V4R_EXPORTS detectMSR(std::vector ¢ers, cv::Mat map_, MRSParams params); 42 | 43 | } //namespace v4r 44 | 45 | #endif //MSR_HPP 46 | -------------------------------------------------------------------------------- /modules/attention_segmentation/include/v4r/attention_segmentation/MapsCombination.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2012 3 | * Ekaterina Potapova 4 | * Automation and Control Institute 5 | * Vienna University of Technology 6 | * Gusshausstraße 25-29 7 | * 1040 Vienna, Austria 8 | * potapova(at)acin.tuwien.ac.at 9 | * 10 | * This program is free software: you can redistribute it and/or modify 11 | * it under the terms of the GNU General Public License as published by 12 | * the Free Software Foundation, either version 3 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * GNU General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU General Public License 21 | * along with this program. If not, see http://www.gnu.org/licenses/ 22 | */ 23 | 24 | 25 | #ifndef MAPS_COMBINATION_HPP 26 | #define MAPS_COMBINATION_HPP 27 | 28 | #include "v4r/attention_segmentation/headers.h" 29 | 30 | namespace v4r 31 | { 32 | 33 | enum CombinationTypes 34 | { 35 | AM_SUM = 0, 36 | AM_MUL, 37 | AM_MIN, 38 | AM_MAX 39 | }; 40 | 41 | // assume that maps are normalized to (0,1) range 42 | int CombineMaps(std::vector &maps, cv::Mat &combinedMap, int combination_type = AM_SUM, 43 | int normalization_type = v4r::NT_NONE); 44 | 45 | } //namespace v4r 46 | 47 | #endif //MAPS_COMBINATION_HPP 48 | -------------------------------------------------------------------------------- /modules/attention_segmentation/include/v4r/attention_segmentation/PCA.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2012 3 | * Ekaterina Potapova 4 | * Automation and Control Institute 5 | * Vienna University of Technology 6 | * Gusshausstraße 25-29 7 | * 1040 Vienna, Austria 8 | * potapova(at)acin.tuwien.ac.at 9 | * 10 | * This program is free software: you can redistribute it and/or modify 11 | * it under the terms of the GNU General Public License as published by 12 | * the Free Software Foundation, either version 3 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * GNU General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU General Public License 21 | * along with this program. If not, see http://www.gnu.org/licenses/ 22 | */ 23 | 24 | #ifndef EPUTILS_PCA_HPP 25 | #define EPUTILS_PCA_HPP 26 | 27 | #include 28 | 29 | #include "v4r/attention_segmentation/eputils_headers.h" 30 | 31 | namespace v4r 32 | { 33 | 34 | Eigen::Vector4f getMean(pcl::PointCloud::ConstPtr cloud); 35 | bool computeCovarianceMatrix(pcl::PointCloud::ConstPtr cloud, const Eigen::Vector4f &mean, Eigen::Matrix3f &cov); 36 | V4R_EXPORTS void principleAxis(pcl::PointCloud::ConstPtr cloud, std::vector &axis); 37 | 38 | } //namespace v4r 39 | 40 | #endif //EPUTILS_PCA_HPP 41 | -------------------------------------------------------------------------------- /modules/attention_segmentation/include/v4r/attention_segmentation/disjoint-set.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2006 Pedro Felzenszwalb 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation; either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | */ 18 | 19 | // disjoint-set forests using union-by-rank and path compression (sort of). 20 | 21 | #ifndef GC_DISJOINT_SET 22 | #define GC_DISJOINT_SET 23 | 24 | #include 25 | 26 | namespace gc 27 | { 28 | 29 | typedef struct { 30 | int rank; // rank of element (starts with 0) 31 | int p; // Parent element 32 | int size; // How many elements are in a set 33 | } uni_elt; 34 | 35 | 36 | class universe { 37 | public: 38 | universe(int elements); 39 | ~universe(); 40 | int find(int x); 41 | void join(int x, int y); 42 | int size(int x) const { return elts[x].size; } 43 | int num_sets() const { return num; } 44 | void printAll(); 45 | 46 | private: 47 | uni_elt *elts; 48 | int num; 49 | }; 50 | 51 | } 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /modules/attention_segmentation/include/v4r/attention_segmentation/headers.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2012 3 | * Ekaterina Potapova 4 | * Automation and Control Institute 5 | * Vienna University of Technology 6 | * Gusshausstraße 25-29 7 | * 1040 Vienna, Austria 8 | * potapova(at)acin.tuwien.ac.at 9 | * 10 | * This program is free software: you can redistribute it and/or modify 11 | * it under the terms of the GNU General Public License as published by 12 | * the Free Software Foundation, either version 3 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * GNU General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU General Public License 21 | * along with this program. If not, see http://www.gnu.org/licenses/ 22 | */ 23 | 24 | 25 | #ifndef ATTENTION_MODULE_HEADERS_HPP 26 | #define ATTENTION_MODULE_HEADERS_HPP 27 | 28 | 29 | // opencv library 30 | #include 31 | 32 | // standart libraries 33 | #include 34 | #include 35 | #include 36 | 37 | #include "v4r/attention_segmentation/AttentionModuleErrors.h" 38 | 39 | // v4r EPUtils library 40 | #include "v4r/attention_segmentation/EPUtils.h" 41 | 42 | // pcl 43 | //#include 44 | 45 | #endif //ATTENTION_MODULE_HEADERS_HPP 46 | -------------------------------------------------------------------------------- /modules/attention_segmentation/include/v4r/attention_segmentation/pyramidFrintrop.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2012 3 | * Ekaterina Potapova 4 | * Automation and Control Institute 5 | * Vienna University of Technology 6 | * Gusshausstraße 25-29 7 | * 1040 Vienna, Austria 8 | * potapova(at)acin.tuwien.ac.at 9 | * 10 | * This program is free software: you can redistribute it and/or modify 11 | * it under the terms of the GNU General Public License as published by 12 | * the Free Software Foundation, either version 3 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * GNU General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU General Public License 21 | * along with this program. If not, see http://www.gnu.org/licenses/ 22 | */ 23 | 24 | 25 | #ifndef PYRAMID_FRINTROP_HPP 26 | #define PYRAMID_FRINTROP_HPP 27 | 28 | #include 29 | #include "v4r/attention_segmentation/pyramidBase.h" 30 | 31 | namespace v4r 32 | { 33 | 34 | class V4R_EXPORTS FrintropPyramid: public BasePyramid 35 | { 36 | public: 37 | FrintropPyramid(); 38 | virtual ~FrintropPyramid(); 39 | typedef boost::shared_ptr Ptr; 40 | 41 | void setR(std::vector &R_); 42 | std::vector getR(); 43 | 44 | void setOnSwitch(bool onSwitch_); 45 | bool getOnSwitch(); 46 | 47 | virtual void reset(); 48 | virtual void print(); 49 | virtual void combinePyramid(bool standard = false); 50 | 51 | private: 52 | std::vector R; 53 | bool onSwitch; 54 | 55 | std::vector pyramidConspicuities; 56 | 57 | }; 58 | 59 | } 60 | #endif 61 | -------------------------------------------------------------------------------- /modules/attention_segmentation/include/v4r/attention_segmentation/pyramidSimple.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2012 3 | * Ekaterina Potapova 4 | * Automation and Control Institute 5 | * Vienna University of Technology 6 | * Gusshausstraße 25-29 7 | * 1040 Vienna, Austria 8 | * potapova(at)acin.tuwien.ac.at 9 | * 10 | * This program is free software: you can redistribute it and/or modify 11 | * it under the terms of the GNU General Public License as published by 12 | * the Free Software Foundation, either version 3 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * GNU General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU General Public License 21 | * along with this program. If not, see http://www.gnu.org/licenses/ 22 | */ 23 | 24 | 25 | #ifndef PYRAMID_SIMPLE_HPP 26 | #define PYRAMID_SIMPLE_HPP 27 | 28 | #include 29 | #include "v4r/attention_segmentation/pyramidBase.h" 30 | 31 | namespace v4r 32 | { 33 | 34 | class V4R_EXPORTS SimplePyramid: public BasePyramid 35 | { 36 | public: 37 | SimplePyramid(); 38 | virtual ~SimplePyramid(); 39 | typedef boost::shared_ptr Ptr; 40 | 41 | virtual void reset(); 42 | virtual void combinePyramid(bool standard = false); 43 | 44 | private: 45 | 46 | }; 47 | 48 | } 49 | #endif //PYRAMID_SIMPLE_HPP 50 | -------------------------------------------------------------------------------- /modules/attention_segmentation/src/ZAdaptiveNormals.cc: -------------------------------------------------------------------------------- 1 | /** 2 | * $Id$ 3 | * 4 | * Copyright (C) 2012 5 | * Andreas Richtsfeld, Johann Prankl, Thomas Mörwald 6 | * Automation and Control Institute 7 | * Vienna University of Technology 8 | * Gusshausstraße 25-29 9 | * 1170 Vienn, Austria 10 | * ari(at)acin.tuwien.ac.at 11 | * 12 | * This program is free software: you can redistribute it and/or modify 13 | * it under the terms of the GNU General Public License as published by 14 | * the Free Software Foundation, either version 3 of the License, or 15 | * (at your option) any later version. 16 | * 17 | * This program is distributed in the hope that it will be useful, 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | * GNU General Public License for more details. 21 | * 22 | * You should have received a copy of the GNU General Public License 23 | * along with this program. If not, see http://www.gnu.org/licenses/ 24 | */ 25 | 26 | 27 | #include "v4r/attention_segmentation/ZAdaptiveNormals.h" 28 | 29 | namespace v4r 30 | { 31 | 32 | 33 | } //namespace v4r 34 | 35 | -------------------------------------------------------------------------------- /modules/camera_tracking_and_mapping/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(the_description "Camera tracking and mapping (incl. temp. smooting filter)") 2 | v4r_define_module(camera_tracking_and_mapping REQUIRED v4r_core v4r_common v4r_io v4r_features v4r_keypoints v4r_reconstruction v4r_recognition opencv) 3 | -------------------------------------------------------------------------------- /modules/camera_tracking_and_mapping/include/v4r/camera_tracking_and_mapping/PoissonTriangulation.hh: -------------------------------------------------------------------------------- 1 | /** 2 | * $Id$ 3 | * 4 | * Software License Agreement (GNU General Public License) 5 | * 6 | * Copyright (C) 2015: 7 | * 8 | * Johann Prankl, prankl@acin.tuwien.ac.at 9 | * Aitor Aldoma, aldoma@acin.tuwien.ac.at 10 | * 11 | * Automation and Control Institute 12 | * Vienna University of Technology 13 | * Gusshausstraße 25-29 14 | * 1170 Vienn, Austria 15 | * 16 | * This program is free software: you can redistribute it and/or modify 17 | * it under the terms of the GNU General Public License as published by 18 | * the Free Software Foundation, either version 3 of the License, or 19 | * (at your option) any later version. 20 | * 21 | * This program is distributed in the hope that it will be useful, 22 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 23 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 24 | * GNU General Public License for more details. 25 | * 26 | * You should have received a copy of the GNU General Public License 27 | * along with this program. If not, see . 28 | * 29 | * @author Johann Prankl, Aitor Aldoma 30 | * 31 | */ 32 | 33 | #include 34 | #include 35 | 36 | namespace v4r 37 | { 38 | 39 | class V4R_EXPORTS PoissonTriangulation 40 | { 41 | private: 42 | int depth; 43 | int samplesPerNode; 44 | bool cropModel; 45 | public: 46 | PoissonTriangulation(int depth, int samplesPerNode, bool cropModel); 47 | 48 | void reconstruct(pcl::PointCloud::Ptr input, pcl::PolygonMesh &mesh); 49 | 50 | void setParameter(int _depth, int _samples_per_node, bool _crop_model) { depth=_depth; samplesPerNode=_samples_per_node; cropModel=_crop_model; } 51 | }; 52 | 53 | } 54 | -------------------------------------------------------------------------------- /modules/change_detection/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(the_description "Point cloud change detection") 2 | v4r_define_module(change_detection REQUIRED v4r_common pcl opencv) 3 | -------------------------------------------------------------------------------- /modules/change_detection/include/v4r/change_detection/impl/miscellaneous.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * miscellaneous.hpp 3 | * 4 | * Created on: 26 Aug 2015 5 | * Author: martin 6 | */ 7 | 8 | #ifndef MISCELLANEOUS_CHANGEDET_HPP_ 9 | #define MISCELLANEOUS_CHANGEDET_HPP_ 10 | 11 | #include 12 | 13 | #include 14 | #include 15 | 16 | namespace v4r { 17 | 18 | template 19 | typename pcl::PointCloud::Ptr downsampleCloud( 20 | typename pcl::PointCloud::Ptr input, 21 | double resolution) { 22 | 23 | pcl::VoxelGrid vg; 24 | typename pcl::PointCloud::Ptr cloud_filtered (new pcl::PointCloud()); 25 | vg.setInputCloud (input); 26 | vg.setLeafSize (resolution, resolution, resolution); 27 | vg.filter (*cloud_filtered); 28 | 29 | return cloud_filtered; 30 | } 31 | 32 | template 33 | Eigen::Affine3f resetViewpoint(typename pcl::PointCloud::Ptr input) { 34 | Eigen::Vector3f offset(input->sensor_origin_(0), 35 | input->sensor_origin_(1), 36 | input->sensor_origin_(2)); 37 | 38 | Eigen::Translation3f translation(offset); 39 | Eigen::Affine3f t(translation * input->sensor_orientation_); 40 | transformPointCloud (*input, *input, t); 41 | 42 | input->sensor_origin_ = Eigen::Vector4f::Zero(); 43 | input->sensor_orientation_ = Eigen::Quaternionf::Identity(); 44 | 45 | return t; 46 | } 47 | 48 | } 49 | 50 | #endif /* MISCELLANEOUS_CHANGEDET_HPP_ */ 51 | -------------------------------------------------------------------------------- /modules/change_detection/include/v4r/change_detection/miscellaneous.h: -------------------------------------------------------------------------------- 1 | /* 2 | * miscellaneous.h 3 | * 4 | * Created on: 26 Aug 2015 5 | * Author: martin 6 | */ 7 | 8 | #ifndef MISCELLANEOUS_CHANGEDET_H_ 9 | #define MISCELLANEOUS_CHANGEDET_H_ 10 | 11 | #include 12 | #include 13 | 14 | namespace v4r { 15 | 16 | template 17 | V4R_EXPORTS typename pcl::PointCloud::Ptr downsampleCloud( 18 | typename pcl::PointCloud::Ptr input, 19 | double resolution = 0.005f); 20 | 21 | template 22 | V4R_EXPORTS Eigen::Affine3f resetViewpoint(typename pcl::PointCloud::Ptr input); 23 | 24 | } 25 | 26 | #include 27 | 28 | #endif /* MISCELLANEOUS_CHANGEDET_H_ */ 29 | -------------------------------------------------------------------------------- /modules/change_detection/src/object_history.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * object_history.cpp 3 | * 4 | * Created on: 28.1.2016 5 | * Author: ivelas 6 | */ 7 | 8 | #include 9 | 10 | template class V4R_EXPORTS v4r::ObjectsHistory; 11 | -------------------------------------------------------------------------------- /modules/change_detection/src/viewport_checker.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * viewport_checker.cpp 3 | * 4 | * Created on: 24.11.2015 5 | * Author: ivelas 6 | */ 7 | 8 | #include 9 | 10 | template class V4R_EXPORTS v4r::ViewVolume; 11 | -------------------------------------------------------------------------------- /modules/common/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(the_description "Common stuff") 2 | v4r_define_module(common REQUIRED v4r_core v4r_io pcl pcl_1_8 opencv boost glog) 3 | -------------------------------------------------------------------------------- /modules/common/include/v4r/common/convertImage.h: -------------------------------------------------------------------------------- 1 | /** 2 | * $Id$ 3 | * 4 | * Copyright (c) 2014, Johann Prankl 5 | * @author Johann Prankl (prankl@acin.tuwien.ac.at) 6 | */ 7 | 8 | #ifndef KP_CONVERT_CLOUDTOIMAGE_HPP 9 | #define KP_CONVERT_CLOUDTOIMAGE_HPP 10 | 11 | #include 12 | #include 13 | #include 14 | #include 15 | //#include 16 | //#include 17 | 18 | 19 | namespace v4r 20 | { 21 | 22 | DEPRECATED( inline void convertImage(const pcl::PointCloud &cloud, cv::Mat &image) ); 23 | 24 | inline void convertImage(const pcl::PointCloud &cloud, cv::Mat &image) 25 | { 26 | image = cv::Mat_(cloud.height, cloud.width); 27 | 28 | for (unsigned v = 0; v < cloud.height; v++) 29 | { 30 | for (unsigned u = 0; u < cloud.width; u++) 31 | { 32 | cv::Vec3b &cv_pt = image.at (v, u); 33 | const pcl::PointXYZRGB &pt = cloud(u,v); 34 | 35 | cv_pt[2] = pt.r; 36 | cv_pt[1] = pt.g; 37 | cv_pt[0] = pt.b; 38 | } 39 | } 40 | } 41 | 42 | 43 | 44 | 45 | } //--END-- 46 | 47 | #endif 48 | 49 | -------------------------------------------------------------------------------- /modules/common/include/v4r/common/faat_3d_rec_framework_defines.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | struct IndexPoint 6 | { 7 | int idx; 8 | }; 9 | 10 | POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::Histogram<1344>, 11 | (float[1344], histogram, histogram1344) 12 | ) 13 | 14 | POINT_CLOUD_REGISTER_POINT_STRUCT (IndexPoint, 15 | (int, idx, idx) 16 | ) 17 | 18 | -------------------------------------------------------------------------------- /modules/common/include/v4r/common/img_utils.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Copyright (c) 2016 Thomas Faeulhammer 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to 6 | * deal in the Software without restriction, including without limitation the 7 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 8 | * sell copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | * 22 | ******************************************************************************/ 23 | 24 | #pragma once 25 | 26 | #include 27 | #include 28 | 29 | 30 | namespace v4r 31 | { 32 | 33 | V4R_EXPORTS cv::Mat cropImage(const cv::Mat &img, const cv::Rect &roi_original, size_t margin=0, bool make_square = false); 34 | 35 | } 36 | -------------------------------------------------------------------------------- /modules/common/include/v4r/common/pcl_visualization_utils.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | namespace v4r 8 | { 9 | class V4R_EXPORTS pcl_visualizer 10 | { 11 | public: 12 | static std::vector visualization_framework (pcl::visualization::PCLVisualizer &vis, 13 | size_t number_of_views, 14 | size_t number_of_subwindows_per_view, 15 | const std::vector &title_subwindows = std::vector()); 16 | }; 17 | 18 | class V4R_EXPORTS PCLVisualizationParams 19 | { 20 | public: 21 | typedef boost::shared_ptr< PCLVisualizationParams > Ptr; 22 | typedef boost::shared_ptr< PCLVisualizationParams const> ConstPtr; 23 | 24 | bool no_text_; ///< optimizes visualization for paper (no text labels...) 25 | int vis_pt_size_; 26 | Eigen::Vector3f text_color_; 27 | Eigen::Vector3i bg_color_; 28 | int fontsize_; 29 | float coordinate_axis_scale_; 30 | PCLVisualizationParams() : 31 | no_text_(false), 32 | vis_pt_size_ (10), 33 | text_color_ (Eigen::Vector3f(0.f,0.f,0.f)), 34 | bg_color_ ( Eigen::Vector3i(255,255,255)), 35 | fontsize_ (12), 36 | coordinate_axis_scale_(0.4f) 37 | { } 38 | }; 39 | } 40 | 41 | -------------------------------------------------------------------------------- /modules/common/include/v4r/common/plane_model.h: -------------------------------------------------------------------------------- 1 | #ifndef V4R_PLANE_MODEL_H__ 2 | #define V4R_PLANE_MODEL_H__ 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | namespace v4r 10 | { 11 | template 12 | class V4R_EXPORTS PlaneModel 13 | { 14 | private: 15 | mutable pcl::visualization::PCLVisualizer::Ptr vis_; 16 | mutable int vp1_, vp2_, vp3_, vp4_; 17 | 18 | public: 19 | EIGEN_MAKE_ALIGNED_OPERATOR_NEW 20 | typedef boost::shared_ptr< PlaneModel> Ptr; 21 | typedef boost::shared_ptr< PlaneModel const> ConstPtr; 22 | 23 | Eigen::Vector4f coefficients_; 24 | pcl::PolygonMeshPtr convex_hull_; 25 | typename pcl::PointCloud::ConstPtr cloud_; 26 | std::vector inliers_; 27 | 28 | // typename pcl::PointCloud::Ptr 29 | // projectPlaneCloud(float resolution=0.005f) const; 30 | 31 | // typename pcl::PointCloud::Ptr 32 | // getConvexHullCloud(); 33 | 34 | bool operator < (const PlaneModel& pm2) const { return inliers_.size() < pm2.inliers_.size(); } 35 | bool operator > (const PlaneModel& pm2) const { return inliers_.size() > pm2.inliers_.size(); } 36 | 37 | void 38 | visualize(); 39 | 40 | 41 | }; 42 | } 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /modules/common/src/img_utils.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace v4r 4 | { 5 | 6 | cv::Mat 7 | cropImage(const cv::Mat &img, const cv::Rect &roi_original, size_t margin, bool make_square) 8 | { 9 | int width = img.cols; 10 | int height = img.rows; 11 | 12 | cv::Rect roi (roi_original); 13 | 14 | if (margin) 15 | { 16 | roi.x = std::max(0, roi_original.x - margin); 17 | roi.y = std::max(0, roi_original.y - margin); 18 | roi.width = std::min(width-1-roi.x, roi_original.width + 2*margin); 19 | roi.height = std::min(height-1-roi.y, roi_original.height + 2*margin); 20 | } 21 | 22 | if (make_square) 23 | { 24 | if(roi.width > roi.height) 25 | { 26 | int extension_half = (roi.width - roi.height) / 2; 27 | roi.y = std::max(0, roi.y - extension_half); 28 | roi.height = std::min(height - roi.y, roi.width); 29 | 30 | if(roi.height < roi.width) // in case the roi reaches outside of image, use some pixel from the other side instead to avoid changing aspect ratio 31 | roi.y = std::max(0, roi.y - (roi.width - roi.height)); 32 | } 33 | else 34 | { 35 | int extension_half = (roi.height - roi.width) / 2; 36 | roi.x = std::max(0, roi.x - extension_half); 37 | roi.width = std::min(width - roi.x, roi.height); 38 | 39 | if(roi.width < roi.height) // in case the roi reaches outside of image, use some pixel from the other side instead to avoid changing aspect ratio 40 | roi.x = std::max(0, roi.x - (roi.height - roi.width)); 41 | } 42 | } 43 | 44 | return cv::Mat(img(roi)); 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /modules/common/src/normal_estimator.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strands-project/v4r/7cb817e05cb9d99cb2f68db009c27d7144d07f09/modules/common/src/normal_estimator.cpp -------------------------------------------------------------------------------- /modules/common/src/normal_estimator_integral_image.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | #include 5 | 6 | #include 7 | 8 | namespace v4r 9 | { 10 | 11 | template 12 | pcl::PointCloud::Ptr 13 | NormalEstimatorIntegralImage::compute() 14 | { 15 | CHECK(input_ && input_->isOrganized()); 16 | 17 | normal_.reset(new pcl::PointCloud); 18 | normal_->points.resize(input_->height * input_->width); 19 | normal_->height = input_->height; 20 | normal_->width = input_->width; 21 | 22 | pcl::IntegralImageNormalEstimation ne; 23 | ne.setNormalEstimationMethod ( ne.COVARIANCE_MATRIX ); 24 | ne.setMaxDepthChangeFactor( param_.max_depth_change_factor_ ); 25 | ne.setNormalSmoothingSize( param_.smoothing_size_ ); 26 | ne.setDepthDependentSmoothing( param_.use_depth_depended_smoothing_ ); 27 | ne.setInputCloud( input_ ); 28 | ne.compute( *normal_) ; 29 | 30 | for(pcl::Normal &n : normal_->points) 31 | { 32 | auto normal = n.getNormalVector3fMap(); 33 | if ( normal.dot(Eigen::Vector3f::UnitZ()) > 0 ) //flip normal towards viewpoint 34 | normal = -normal; 35 | 36 | normal.normalize(); 37 | } 38 | 39 | return normal_; 40 | } 41 | 42 | 43 | #define PCL_INSTANTIATE_NormalEstimatorIntegralImage(T) template class V4R_EXPORTS NormalEstimatorIntegralImage; 44 | PCL_INSTANTIATE(NormalEstimatorIntegralImage, PCL_XYZ_POINT_TYPES ) 45 | 46 | } 47 | -------------------------------------------------------------------------------- /modules/common/src/normal_estimator_pcl.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include 6 | #include 7 | 8 | namespace v4r 9 | { 10 | 11 | template 12 | pcl::PointCloud::Ptr 13 | NormalEstimatorPCL::compute() 14 | { 15 | normal_.reset(new pcl::PointCloud); 16 | 17 | typename pcl::search::KdTree::Ptr tree (new pcl::search::KdTree ); 18 | tree->setInputCloud(input_); 19 | 20 | boost::shared_ptr< std::vector > IndicesPtr (new std::vector); 21 | *IndicesPtr = indices_; 22 | 23 | if( param_.use_omp_ ) 24 | { 25 | pcl::NormalEstimationOMP ne; 26 | ne.setRadiusSearch ( param_.radius_ ); 27 | ne.setInputCloud ( input_ ); 28 | ne.setSearchMethod(tree); 29 | if(!indices_.empty()) 30 | ne.setIndices(IndicesPtr); 31 | ne.compute ( *normal_ ); 32 | } 33 | else 34 | { 35 | pcl::NormalEstimation ne; 36 | ne.setRadiusSearch ( param_.radius_ ); 37 | ne.setInputCloud (input_); 38 | ne.setSearchMethod(tree); 39 | if(!indices_.empty()) 40 | ne.setIndices(IndicesPtr); 41 | ne.compute (*normal_); 42 | } 43 | 44 | indices_.clear(); 45 | return normal_; 46 | } 47 | 48 | 49 | #define PCL_INSTANTIATE_NormalEstimatorPCL(T) template class V4R_EXPORTS NormalEstimatorPCL; 50 | PCL_INSTANTIATE(NormalEstimatorPCL, PCL_XYZ_POINT_TYPES ) 51 | 52 | } 53 | -------------------------------------------------------------------------------- /modules/common/src/visibility_reasoning.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | template class V4R_EXPORTS v4r::VisibilityReasoning; 5 | template class V4R_EXPORTS v4r::VisibilityReasoning; 6 | -------------------------------------------------------------------------------- /modules/core/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(the_description "Core headers") 2 | v4r_define_module(core) 3 | -------------------------------------------------------------------------------- /modules/core/include/v4r/core/macros.h: -------------------------------------------------------------------------------- 1 | #ifndef V4R_COMMON_MACROS_H_ 2 | #define V4R_COMMON_MACROS_H_ 3 | 4 | #if (defined WIN32 || defined _WIN32 || defined WINCE || defined __CYGWIN__) && defined V4RAPI_EXPORTS 5 | # define V4R_EXPORTS __declspec(dllexport) 6 | #elif defined __GNUC__ && __GNUC__ >= 4 7 | # define V4R_EXPORTS __attribute__ ((visibility ("default"))) 8 | #else 9 | # define V4R_EXPORTS 10 | #endif 11 | 12 | #ifdef __GNUC__ 13 | #define DEPRECATED(func) func __attribute__ ((deprecated)) 14 | #elif defined(_MSC_VER) 15 | #define DEPRECATED(func) __declspec(deprecated) func 16 | #else 17 | #pragma message("WARNING: You need to implement DEPRECATED for this compiler") 18 | #define DEPRECATED(func) func 19 | #endif 20 | 21 | #endif /* V4R_COMMON_MACROS_H_ */ 22 | 23 | -------------------------------------------------------------------------------- /modules/core/include/v4r/core/version.h: -------------------------------------------------------------------------------- 1 | #ifndef __V4R_VERSION_HPP__ 2 | #define __V4R_VERSION_HPP__ 3 | 4 | #define V4R_VERSION_MAJOR 1 5 | #define V4R_VERSION_MINOR 0 6 | #define V4R_VERSION_REVISION 0 7 | #define V4R_VERSION_STATUS "-dev" 8 | 9 | #define V4RAUX_STR_EXP(__A) #__A 10 | #define V4RAUX_STR(__A) V4RAUX_STR_EXP(__A) 11 | 12 | #define V4RAUX_STRW_EXP(__A) L#__A 13 | #define V4RAUX_STRW(__A) V4RAUX_STRW_EXP(__A) 14 | 15 | #define V4R_VERSION V4RAUX_STR(V4R_VERSION_MAJOR) "." V4RAUX_STR(V4R_VERSION_MINOR) "." V4RAUX_STR(V4R_VERSION_REVISION) V4R_VERSION_STATUS 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /modules/core/src/foobar.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strands-project/v4r/7cb817e05cb9d99cb2f68db009c27d7144d07f09/modules/core/src/foobar.cpp -------------------------------------------------------------------------------- /modules/features/include/v4r/features/FeatureDetectorHeaders.h: -------------------------------------------------------------------------------- 1 | /** 2 | * $Id$ 3 | * 4 | * Software License Agreement (GNU General Public License) 5 | * 6 | * Copyright (C) 2015: 7 | * 8 | * Johann Prankl, prankl@acin.tuwien.ac.at 9 | * Aitor Aldoma, aldoma@acin.tuwien.ac.at 10 | * 11 | * Automation and Control Institute 12 | * Vienna University of Technology 13 | * Gusshausstraße 25-29 14 | * 1170 Vienn, Austria 15 | * 16 | * This program is free software: you can redistribute it and/or modify 17 | * it under the terms of the GNU General Public License as published by 18 | * the Free Software Foundation, either version 3 of the License, or 19 | * (at your option) any later version. 20 | * 21 | * This program is distributed in the hope that it will be useful, 22 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 23 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 24 | * GNU General Public License for more details. 25 | * 26 | * You should have received a copy of the GNU General Public License 27 | * along with this program. If not, see . 28 | * 29 | * @author Johann Prankl, Aitor Aldoma 30 | * 31 | */ 32 | 33 | #ifndef V4R_FEATURE_DETECTOR_HEADERS_HH 34 | #define V4R_FEATURE_DETECTOR_HEADERS_HH 35 | 36 | #include "FeatureDetector.h" 37 | #include "FeatureDetector_K_HARRIS.h" 38 | // #include "FeatureDetector_D_FREAK.h" 39 | #include "FeatureDetector_KD_ORB.h" 40 | #include "FeatureDetector_KD_FAST_IMGD.h" 41 | 42 | 43 | #endif 44 | 45 | -------------------------------------------------------------------------------- /modules/features/include/v4r/features/all_headers.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Copyright (c) 2016 Thomas Faeulhammer 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to 6 | * deal in the Software without restriction, including without limitation the 7 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 8 | * sell copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | * 22 | ******************************************************************************/ 23 | 24 | #pragma once 25 | 26 | #include 27 | #include 28 | 29 | #include 30 | #include 31 | #include 32 | #include 33 | //#include 34 | #ifdef HAVE_CAFFE 35 | #include 36 | #endif 37 | -------------------------------------------------------------------------------- /modules/features/src/esf_estimator.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | namespace v4r 5 | { 6 | template 7 | bool 8 | ESFEstimation::compute (Eigen::MatrixXf &signature) 9 | { 10 | CHECK(cloud_ && !cloud_->points.empty()); 11 | typename pcl::ESFEstimation esf; 12 | pcl::PointCloud ESF_signature; 13 | 14 | if(!indices_.empty()) /// NOTE: setIndices does not seem to work for ESF 15 | { 16 | typename pcl::PointCloud::Ptr cloud_roi (new pcl::PointCloud); 17 | pcl::copyPointCloud(*cloud_, indices_, *cloud_roi); 18 | esf.setInputCloud(cloud_roi); 19 | } 20 | else 21 | esf.setInputCloud (cloud_); 22 | 23 | esf.compute (ESF_signature); 24 | signature.resize(ESF_signature.points.size(), feature_dimensions_); 25 | 26 | for(size_t pt=0; pt; 39 | template class V4R_EXPORTS v4r::ESFEstimation; 40 | -------------------------------------------------------------------------------- /modules/features/src/global_simple_shape_estimator.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | namespace v4r 5 | { 6 | template 7 | bool 8 | SimpleShapeEstimator::compute (Eigen::MatrixXf &signature) 9 | { 10 | CHECK(cloud_ && !cloud_->points.empty()); 11 | 12 | Eigen::Vector4f centroid; 13 | Eigen::Vector3f elongationsXYZ; 14 | Eigen::Matrix4f eigenBasis; 15 | 16 | v4r::computePointCloudProperties( *cloud_, centroid, elongationsXYZ, eigenBasis, indices_); 17 | 18 | signature = Eigen::MatrixXf(1, feature_dimensions_); 19 | signature.row(0) = elongationsXYZ; 20 | indices_.clear(); 21 | 22 | return true; 23 | } 24 | 25 | template class V4R_EXPORTS SimpleShapeEstimator; 26 | template class V4R_EXPORTS SimpleShapeEstimator; 27 | } 28 | 29 | -------------------------------------------------------------------------------- /modules/io/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(the_description "I/O") 2 | v4r_define_module(io REQUIRED v4r_core OPTIONAL boost eigen) 3 | 4 | -------------------------------------------------------------------------------- /modules/keypoints/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(the_description "Keypoints") 2 | v4r_define_module(keypoints REQUIRED v4r_core v4r_common pcl pcl_1_8 opencv) 3 | -------------------------------------------------------------------------------- /modules/keypoints/include/v4r/keypoints/impl/pair_serialization.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * $Id$ 3 | * 4 | * Software License Agreement (GNU General Public License) 5 | * 6 | * Copyright (C) 2015: 7 | * 8 | * Johann Prankl, prankl@acin.tuwien.ac.at 9 | * Aitor Aldoma, aldoma@acin.tuwien.ac.at 10 | * 11 | * Automation and Control Institute 12 | * Vienna University of Technology 13 | * Gusshausstraße 25-29 14 | * 1170 Vienn, Austria 15 | * 16 | * This program is free software: you can redistribute it and/or modify 17 | * it under the terms of the GNU General Public License as published by 18 | * the Free Software Foundation, either version 3 of the License, or 19 | * (at your option) any later version. 20 | * 21 | * This program is distributed in the hope that it will be useful, 22 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 23 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 24 | * GNU General Public License for more details. 25 | * 26 | * You should have received a copy of the GNU General Public License 27 | * along with this program. If not, see . 28 | * 29 | * @author Johann Prankl, Aitor Aldoma 30 | * 31 | */ 32 | 33 | #ifndef KP_PAIR_SERI_HPP 34 | #define KP_PAIR_SERI_HPP 35 | 36 | 37 | #include 38 | #include 39 | #include 40 | 41 | //A makro to get rid of the unused warning 42 | #ifndef UNUSED 43 | #define UNUSED(expr) do { (void)(expr); } while (0) 44 | #endif 45 | 46 | namespace boost { 47 | namespace serialization { 48 | 49 | template 50 | void serialize(Archive & ar, std::pair &t, const unsigned int version) 51 | { 52 | UNUSED(version); 53 | ar & t.first; 54 | ar & t.second; 55 | } 56 | 57 | } 58 | } 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /modules/keypoints/include/v4r/keypoints/impl/toString.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * $Id$ 3 | * 4 | * Software License Agreement (GNU General Public License) 5 | * 6 | * Copyright (C) 2015: 7 | * 8 | * Johann Prankl, prankl@acin.tuwien.ac.at 9 | * Aitor Aldoma, aldoma@acin.tuwien.ac.at 10 | * 11 | * Automation and Control Institute 12 | * Vienna University of Technology 13 | * Gusshausstraße 25-29 14 | * 1170 Vienn, Austria 15 | * 16 | * This program is free software: you can redistribute it and/or modify 17 | * it under the terms of the GNU General Public License as published by 18 | * the Free Software Foundation, either version 3 of the License, or 19 | * (at your option) any later version. 20 | * 21 | * This program is distributed in the hope that it will be useful, 22 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 23 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 24 | * GNU General Public License for more details. 25 | * 26 | * You should have received a copy of the GNU General Public License 27 | * along with this program. If not, see . 28 | * 29 | * @author Johann Prankl, Aitor Aldoma 30 | * 31 | */ 32 | 33 | #ifndef KP_TO_STRING_HH 34 | #define KP_TO_STRING_HH 35 | 36 | #include 37 | #include 38 | 39 | namespace v4r 40 | { 41 | 42 | template 43 | inline std::string toString (const T& t, unsigned precision=2) 44 | { 45 | std::stringstream ss; 46 | ss << std::setprecision(precision) << t; 47 | return ss.str(); 48 | } 49 | 50 | 51 | } 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /modules/keypoints/include/v4r/keypoints/io.h: -------------------------------------------------------------------------------- 1 | /** 2 | * $Id$ 3 | * 4 | * Software License Agreement (GNU General Public License) 5 | * 6 | * Copyright (C) 2015: 7 | * 8 | * Johann Prankl, prankl@acin.tuwien.ac.at 9 | * Aitor Aldoma, aldoma@acin.tuwien.ac.at 10 | * 11 | * Automation and Control Institute 12 | * Vienna University of Technology 13 | * Gusshausstraße 25-29 14 | * 1170 Vienn, Austria 15 | * 16 | * This program is free software: you can redistribute it and/or modify 17 | * it under the terms of the GNU General Public License as published by 18 | * the Free Software Foundation, either version 3 of the License, or 19 | * (at your option) any later version. 20 | * 21 | * This program is distributed in the hope that it will be useful, 22 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 23 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 24 | * GNU General Public License for more details. 25 | * 26 | * You should have received a copy of the GNU General Public License 27 | * along with this program. If not, see . 28 | * 29 | * @author Johann Prankl, Aitor Aldoma 30 | * 31 | */ 32 | 33 | #ifndef KP_ARTICULATED_OBJECT_IO_HH 34 | #define KP_ARTICULATED_OBJECT_IO_HH 35 | 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | 44 | namespace v4r 45 | { 46 | namespace io 47 | { 48 | V4R_EXPORTS bool write(const std::string &file, const ArticulatedObject::Ptr &model); 49 | V4R_EXPORTS bool read(const std::string &file, ArticulatedObject::Ptr &model); 50 | } 51 | } 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /modules/keypoints/include/v4r/keypoints/types.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Copyright (c) 2016 Thomas Faeulhammer 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to 6 | * deal in the Software without restriction, including without limitation the 7 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 8 | * sell copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | * 22 | ******************************************************************************/ 23 | 24 | #pragma once 25 | 26 | namespace v4r 27 | { 28 | enum KeypointType 29 | { 30 | UniformSampling = 0x01, // 00000001 31 | ISS = 0x02, // 00000010 32 | NARF = 0x04, // 00000100 33 | HARRIS3D = 0x08 // 00000100 34 | }; 35 | } 36 | -------------------------------------------------------------------------------- /modules/keypoints/src/harris3d_keypoint_extractor.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | namespace v4r 5 | { 6 | 7 | template 8 | void 9 | Harris3DKeypointExtractor::compute () 10 | { 11 | #if PCL_VERSION >= 100702 12 | typename pcl::search::OrganizedNeighbor::Ptr search_method (new pcl::search::OrganizedNeighbor ()); 13 | pcl::HarrisKeypoint3D detector; 14 | detector.setNonMaxSupression (true); 15 | detector.setRadiusSearch(param_.search_radius_); 16 | detector.setThreshold (param_.threshold_); 17 | detector.setRefine(param_.refine_); 18 | detector.setSearchMethod(search_method); 19 | detector.setNormals(normals_); 20 | detector.setInputCloud (input_); 21 | pcl::PointCloud::Ptr keypoint_idx (new pcl::PointCloud); 22 | detector.compute (*keypoint_idx); 23 | pcl::PointIndicesConstPtr keypoints_indices = detector.getKeypointsIndices (); 24 | 25 | keypoint_indices_.resize( keypoints_indices->indices.size() ); 26 | for(size_t i=0; i < keypoints_indices->indices.size(); i++) 27 | keypoint_indices_[i] = keypoints_indices->indices[i]; 28 | 29 | #else 30 | std::cerr << "HARRIS 3D is not available with keypointindices for this PCL version!" << std::endl; 31 | #endif 32 | } 33 | 34 | template class V4R_EXPORTS Harris3DKeypointExtractor; 35 | template class V4R_EXPORTS Harris3DKeypointExtractor; 36 | } 37 | -------------------------------------------------------------------------------- /modules/keypoints/src/keypoint_extractor.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace v4r 4 | { 5 | template KeypointExtractor::~KeypointExtractor(){} 6 | 7 | template class V4R_EXPORTS KeypointExtractor; 8 | template class V4R_EXPORTS KeypointExtractor; 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /modules/keypoints/src/uniform_sampling_extractor.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | namespace v4r 5 | { 6 | 7 | template 8 | void 9 | UniformSamplingExtractor::compute () 10 | { 11 | pcl_1_8::UniformSampling us; 12 | us.setRadiusSearch ( param_.sampling_density_ ); 13 | us.setInputCloud (input_); 14 | if(!indices_.empty()) 15 | { 16 | boost::shared_ptr > IndicesPtr (new std::vector); 17 | *IndicesPtr = indices_; 18 | us.setIndices(IndicesPtr); 19 | } 20 | pcl::PointCloud keypoints_idxes; 21 | us.compute(keypoints_idxes); 22 | 23 | keypoint_indices_.resize (keypoints_idxes.points.size ()); 24 | for(size_t i=0; i < keypoints_idxes.points.size(); i++) 25 | keypoint_indices_[i] = keypoints_idxes.points[i]; 26 | 27 | indices_.clear(); 28 | } 29 | 30 | template class V4R_EXPORTS UniformSamplingExtractor; 31 | template class V4R_EXPORTS UniformSamplingExtractor; 32 | } 33 | -------------------------------------------------------------------------------- /modules/ml/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(the_description "Machine Learning") 2 | v4r_define_module(ml REQUIRED v4r_core v4r_common v4r_io pcl opencv libsvm glog boost eigen) 3 | -------------------------------------------------------------------------------- /modules/ml/include/v4r/ml/ml_utils.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | namespace v4r 6 | { 7 | 8 | /** 9 | * @brief sortTrainingData sorts training data such that the labels are in ascending order 10 | * @param data_train 11 | * @param target_train 12 | */ 13 | V4R_EXPORTS 14 | void sortTrainingData(Eigen::MatrixXf &data_train, Eigen::VectorXi &target_train); 15 | 16 | /** 17 | * @brief shuffleTrainingData shuffles training data randomly together with the target label 18 | * @param data_train 19 | * @param target_train 20 | */ 21 | V4R_EXPORTS 22 | void shuffleTrainingData(Eigen::MatrixXf &data, Eigen::VectorXi &target); 23 | 24 | 25 | /** 26 | * @brief computeConfusionMatrix computes confusion matrix 27 | * @param actual_label actual label 28 | * @param predicted_label predicted label 29 | * @return confusion_matrix confusion matrix 30 | */ 31 | Eigen::MatrixXi 32 | computeConfusionMatrix(const Eigen::VectorXi &actual_label, const Eigen::VectorXi &predicted_label, size_t num_classes); 33 | 34 | } 35 | 36 | -------------------------------------------------------------------------------- /modules/ml/include/v4r/ml/types.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Copyright (c) 2015 Thomas Faeulhammer 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to 6 | * deal in the Software without restriction, including without limitation the 7 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 8 | * sell copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | * 22 | ******************************************************************************/ 23 | 24 | #pragma once 25 | 26 | namespace v4r 27 | { 28 | enum ClassifierType 29 | { 30 | KNN = 0x01, // 00000001 31 | SVM = 0x02, // 00000010 32 | CNN = 0x04 // 00000100 33 | // RandomForest = 0x08 // 00001000 34 | }; 35 | } 36 | -------------------------------------------------------------------------------- /modules/ml/src/nearestNeighbor.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | namespace v4r 5 | { 6 | 7 | void 8 | NearestNeighborClassifier::train(const Eigen::MatrixXf &training_data, const Eigen::VectorXi &training_label) 9 | { 10 | CHECK ( training_data.rows() == training_label.rows() ); 11 | 12 | flann_.reset ( new EigenFLANN); 13 | flann_->param_.knn_ = param_.knn_; 14 | flann_->param_.distance_metric_ = param_.distance_metric_; 15 | flann_->param_.kdtree_splits_ = param_.kdtree_splits_; 16 | flann_->createFLANN(training_data); 17 | 18 | training_label_ = training_label; 19 | } 20 | 21 | void 22 | NearestNeighborClassifier::predict(const Eigen::MatrixXf &query_data, Eigen::MatrixXi &predicted_label) const 23 | { 24 | flann_->nearestKSearch(query_data, knn_indices_, knn_distances_); 25 | 26 | predicted_label.resize( knn_indices_.rows() ,knn_indices_.cols() ); 27 | 28 | for(int row_id=0; row_id 5 | #include 6 | #include 7 | #include 8 | 9 | #include 10 | #include 11 | #include 12 | 13 | #include "boost_graph_extension.h" 14 | 15 | typedef pcl::PointXYZRGB PointT; 16 | typedef pcl::PointCloud PointInT; 17 | typedef PointInT::ConstPtr ConstPointInTPtr; 18 | typedef boost::shared_ptr< PointInT > PointInTPtr; 19 | 20 | typedef pcl::PointCloud::ConstPtr ConstPointInTPtr; 21 | 22 | class BoostGraphVisualizer 23 | { 24 | private: 25 | pcl::visualization::PCLVisualizer::Ptr edge_vis_; 26 | pcl::visualization::PCLVisualizer::Ptr keypoints_vis_; 27 | int v1, v2; 28 | 29 | public: 30 | BoostGraphVisualizer(){ 31 | } 32 | 33 | void visualizeEdge (const EdgeD &edge, const MVGraph &grph); 34 | 35 | void visualizeGraph ( const MVGraph & grph, pcl::visualization::PCLVisualizer::Ptr &vis); 36 | 37 | void visualizeWorkflow ( const ViewD &vrtx, const MVGraph &grph, boost::shared_ptr< pcl::PointCloud > pAccumulatedKeypoints); 38 | }; 39 | 40 | #endif // BOOST_GRAPH_VISUALIZATION_EXTENSION_H 41 | -------------------------------------------------------------------------------- /modules/recognition/src/multiview_object_recognizer.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | //template class V4R_EXPORTS v4r::MultiviewRecognizer; 5 | -------------------------------------------------------------------------------- /modules/recognition/src/multiview_object_recognizer_change_detection.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | //template class V4R_EXPORTS v4r::MultiviewRecognizerWithChangeDetection; 4 | -------------------------------------------------------------------------------- /modules/recognition/src/multiview_representation.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace v4r 4 | { 5 | 6 | template 7 | View::View () 8 | { 9 | // scene_f_.reset ( new pcl::PointCloud ); 10 | scene_normals_.reset ( new pcl::PointCloud ); 11 | // kp_normals_.reset ( new pcl::PointCloud ); 12 | absolute_pose_ = Eigen::Matrix4f::Identity(); 13 | has_been_hopped_ = false; 14 | cumulative_weight_to_new_vrtx_ = 0; 15 | } 16 | 17 | template class V4R_EXPORTS View; 18 | } 19 | 20 | -------------------------------------------------------------------------------- /modules/recognition/src/object_hypothesis.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | 6 | namespace v4r 7 | { 8 | size_t ObjectHypothesis::s_counter_ = 0; 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /modules/recognition/src/recognition_pipeline.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | namespace v4r 5 | { 6 | 7 | template 8 | std::vector > RecognitionPipeline::elapsed_time_; 9 | 10 | #define PCL_INSTANTIATE_RecognitionPipeline(T) template class V4R_EXPORTS RecognitionPipeline; 11 | PCL_INSTANTIATE(RecognitionPipeline, (pcl::PointXYZRGB)) 12 | 13 | } 14 | -------------------------------------------------------------------------------- /modules/reconstruction/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(the_description "Reconstruction") 2 | v4r_define_module(reconstruction REQUIRED v4r_core v4r_io v4r_features pcl opencv OPTIONAL ceres) 3 | -------------------------------------------------------------------------------- /modules/registration/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(the_description "Registration") 2 | v4r_define_module(registration REQUIRED v4r_core v4r_io v4r_features pcl pcl_1_8 ceres opencv OPTIONAL edt siftgpu) 3 | -------------------------------------------------------------------------------- /modules/registration/src/PartialModelRegistrationBase.cpp: -------------------------------------------------------------------------------- 1 | #include "v4r/registration/MultiSessionModelling.h" 2 | 3 | template 4 | size_t 5 | v4r::Registration::PartialModelRegistrationBase::getTotalNumberOfClouds() 6 | { 7 | return msm_->getTotalNumberOfClouds(); 8 | } 9 | 10 | template 11 | typename pcl::PointCloud::ConstPtr 12 | v4r::Registration::PartialModelRegistrationBase::getCloud(size_t i) const 13 | { 14 | return msm_->getCloud(i); 15 | } 16 | 17 | template 18 | std::vector & 19 | v4r::Registration::PartialModelRegistrationBase::getIndices(size_t i) const 20 | { 21 | return msm_->getIndices(i); 22 | } 23 | 24 | template 25 | Eigen::Matrix4f 26 | v4r::Registration::PartialModelRegistrationBase::getPose(size_t i) const 27 | { 28 | return msm_->getPose(i); 29 | } 30 | 31 | template 32 | pcl::PointCloud::ConstPtr 33 | v4r::Registration::PartialModelRegistrationBase::getNormal(size_t i) const 34 | { 35 | return msm_->getNormal(i); 36 | } 37 | 38 | template class V4R_EXPORTS v4r::Registration::PartialModelRegistrationBase; 39 | 40 | -------------------------------------------------------------------------------- /modules/registration/src/fast_icp_with_gc.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * fast_icp_with_gc.cpp 3 | * 4 | * Created on: Sep 8, 2013 5 | * Author: aitor 6 | */ 7 | 8 | #include 9 | #include 10 | 11 | template class V4R_EXPORTS v4r::ICPNode; 12 | template class V4R_EXPORTS v4r::FastIterativeClosestPointWithGC; 13 | 14 | -------------------------------------------------------------------------------- /modules/rendering/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(the_description "Rendering") 2 | v4r_define_module(rendering REQUIRED v4r_core v4r_common pcl opencv boost opengl glew assimp glm) 3 | -------------------------------------------------------------------------------- /modules/segmentation/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(the_description "Segmentation") 2 | v4r_define_module(segmentation REQUIRED v4r_core v4r_common v4r_io pcl opencv) 3 | -------------------------------------------------------------------------------- /modules/segmentation/include/v4r/segmentation/segmentation_utils.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | 6 | namespace v4r 7 | { 8 | 9 | /** 10 | * @brief visualize clustering output 11 | * @param input cloud 12 | * @param indices of points belonging to the individual clusters 13 | */ 14 | template 15 | V4R_EXPORTS 16 | void 17 | visualizeCluster(const typename pcl::PointCloud::ConstPtr &cloud, const std::vector &cluster_indices, const std::string &window_title = "Segmentation results" ); 18 | 19 | 20 | /** 21 | * @brief visualize clustering output 22 | * @param input cloud 23 | * @param indices of points belonging to the individual clusters 24 | */ 25 | template 26 | V4R_EXPORTS 27 | void 28 | visualizeClusters(const typename pcl::PointCloud::ConstPtr &cloud, const std::vector< std::vector > &cluster_indices, const std::string &window_title = "Segmentation results"); 29 | 30 | } 31 | 32 | -------------------------------------------------------------------------------- /modules/semantic_segmentation/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(the_description "Semantic Segmentation") 2 | v4r_define_module(semantic_segmentation REQUIRED v4r_core pcl boost eigen opencv) 3 | -------------------------------------------------------------------------------- /modules/semantic_segmentation/src/supervoxel_segmentation.cpp: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Copyright (c) 2017 Daniel Wolf 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to 6 | * deal in the Software without restriction, including without limitation the 7 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 8 | * sell copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | * 22 | ******************************************************************************/ 23 | 24 | #include 25 | 26 | #include 27 | #include 28 | 29 | template class V4R_EXPORTS v4r::SupervoxelSegmentation; 30 | template class V4R_EXPORTS v4r::SupervoxelSegmentation; 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /modules/tracking/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(the_description "Tracking") 2 | v4r_define_module(tracking REQUIRED v4r_core v4r_common v4r_io v4r_features v4r_registration v4r_keypoints v4r_reconstruction opencv) 3 | -------------------------------------------------------------------------------- /samples/eval/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | if(BUILD_EVALUATION_TOOLS) 2 | SET(sample_kind eval) 3 | SET(sample_KIND EVAL) 4 | 5 | SET(V4R_DEPS v4r_ml v4r_recognition v4r_rendering v4r_segmentation) 6 | V4R_DEFINE_CPP_EXAMPLE(esf_object_classifier) 7 | 8 | SET(V4R_DEPS v4r_object_modelling) 9 | V4R_DEFINE_CPP_EXAMPLE(incremental_object_learning) 10 | 11 | #SET(V4R_DEPS v4r_recognition) 12 | #V4R_DEFINE_CPP_EXAMPLE(object_recognizer_multiview) 13 | 14 | endif() 15 | 16 | if (INSTALL_C_EVALUATION_TOOLS AND NOT WIN32) 17 | file(GLOB C_SAMPLES *.c *.cpp *.jpg *.png *.data makefile.* build_all.sh *.dsp *.cmd ) 18 | install(FILES ${C_SAMPLES} 19 | DESTINATION ${V4R_SAMPLES_SRC_INSTALL_PATH}/cpp 20 | PERMISSIONS OWNER_READ GROUP_READ WORLD_READ COMPONENT samples) 21 | endif() 22 | -------------------------------------------------------------------------------- /samples/examples/classify_with_SVM_tmp.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | const std::string out_fn = "/tmp/feat+label_libsvm.txt"; 8 | 9 | bool trainSVM(const std::string &training_data_file, const std::string &training_label_file); 10 | 11 | bool trainSVM(const std::string &training_data_file, const std::string &training_label_file) 12 | { 13 | std::vector labels; 14 | 15 | // fill label/target samples 16 | std::ifstream file; 17 | file.open(training_label_file.c_str(), std::ifstream::in); 18 | 19 | std::string line; 20 | while( std::getline(file, line)) 21 | { 22 | std::stringstream lineStream(line); 23 | double label; 24 | lineStream >> label; 25 | labels.push_back(label); 26 | } 27 | file.close(); 28 | 29 | std::ofstream of (out_fn.c_str()); 30 | size_t row = 0; 31 | // fill training x samples 32 | file.open(training_data_file.c_str(), std::ifstream::in); 33 | while( std::getline(file, line)) 34 | { 35 | std::stringstream lineStream(line); 36 | of << labels[row++] << " "; 37 | double feat_elem; 38 | size_t feat_id = 0; 39 | while (lineStream >> feat_elem) { 40 | of << feat_id++ << ":" << feat_elem << " "; 41 | } 42 | of << std::endl; 43 | } 44 | file.close(); 45 | 46 | return true; 47 | } 48 | 49 | int main(int argc, char** argv) 50 | { 51 | std::string training_data_file, 52 | training_label_file; 53 | 54 | pcl::console::parse_argument (argc, argv, "-training_data_file", training_data_file); 55 | pcl::console::parse_argument (argc, argv, "-training_label_file", training_label_file); 56 | trainSVM(training_data_file, training_label_file); 57 | } 58 | -------------------------------------------------------------------------------- /samples/tools/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | if(BUILD_UTILITY_TOOLS) 2 | 3 | if(CMAKE_COMPILER_IS_GNUCXX AND NOT ENABLE_NOISY_WARNINGS) 4 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-function") 5 | endif() 6 | 7 | SET(sample_kind tool) 8 | SET(sample_KIND TOOL) 9 | 10 | SET(V4R_DEPS v4r_common v4r_io) 11 | V4R_DEFINE_CPP_EXAMPLE(convertOldModelDatabaseToNew) 12 | 13 | SET(V4R_DEPS v4r_recognition) 14 | V4R_DEFINE_CPP_EXAMPLE(create_annotated_images_from_recognition_gt_data) 15 | 16 | SET(V4R_DEPS v4r_common v4r_io v4r_rendering) 17 | V4R_DEFINE_CPP_EXAMPLE(create_classification_db_from_ply_files) 18 | 19 | SET(V4R_DEPS v4r_common v4r_io) 20 | V4R_DEFINE_CPP_EXAMPLE(pcd2png) 21 | 22 | SET(V4R_DEPS v4r_recognition) 23 | V4R_DEFINE_CPP_EXAMPLE(pcd_ground_truth_labelling) 24 | 25 | SET(V4R_DEPS v4r_common v4r_io) 26 | V4R_DEFINE_CPP_EXAMPLE(save_pose_into_pcd) 27 | 28 | SET(V4R_DEPS v4r_common v4r_io) 29 | V4R_DEFINE_CPP_EXAMPLE(view_all_point_clouds_in_folder) 30 | 31 | SET(V4R_DEPS) 32 | V4R_DEFINE_CPP_EXAMPLE(visualize_hypothesis) 33 | 34 | endif() 35 | 36 | if (INSTALL_C_UTILITY_TOOLS AND NOT WIN32) 37 | file(GLOB C_SAMPLES *.c *.cpp *.jpg *.png *.data makefile.* build_all.sh *.dsp *.cmd ) 38 | install(FILES ${C_SAMPLES} 39 | DESTINATION ${V4R_SAMPLES_SRC_INSTALL_PATH}/cpp 40 | PERMISSIONS OWNER_READ GROUP_READ WORLD_READ COMPONENT samples) 41 | endif() 42 | -------------------------------------------------------------------------------- /scripts/NYU_Depth_Dataset/v1/mat2pcl/license.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013, Peter Corke 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are 6 | met: 7 | 8 | * Redistributions of source code must retain the above copyright 9 | notice, this list of conditions and the following disclaimer. 10 | * Redistributions in binary form must reproduce the above copyright 11 | notice, this list of conditions and the following disclaimer in 12 | the documentation and/or other materials provided with the distribution 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 18 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 19 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 20 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 21 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 22 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 23 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 24 | POSSIBILITY OF SUCH DAMAGE. 25 | -------------------------------------------------------------------------------- /scripts/NYU_Depth_Dataset/v1/mat2pcl/pclviewer.m: -------------------------------------------------------------------------------- 1 | %PCLVIEWER View a point cloud using PCL 2 | % 3 | % PCLVIEWER(P) writes the point cloud P (MxN) to a temporary file and invokes 4 | % the PCL point cloud viewer for fast display and visualization. The columns of P 5 | % represent the 3D points. 6 | % 7 | % If M=3 then the rows are x, y, z. 8 | % If M=6 then the rows are x, y, z, R, G, B where R,G,B are in the range 0 9 | % to 1. 10 | % 11 | % PCLVIEWER(P, ARGS) as above but the optional arguments ARGS are passed to the 12 | % PCL viewer. For example: 13 | % 14 | % pclviewer( rand(3,1000), '-ps 2 -ax 1' ) 15 | % 16 | % Notes:: 17 | % - Only the "x y z" and "x y z rgb" field formats are currently supported. 18 | % - The file is written in ascii format. 19 | % - When viewing colored point clouds in pcl_viewer remember to toggle to 20 | % 21 | % See also savepcd, lspcd, readpcd. 22 | % 23 | % Copyright (C) 2013, by Peter I. Corke 24 | 25 | % TODO 26 | % - add color 27 | 28 | 29 | function pclviewer(points, args) 30 | 31 | % change the next line to suit your operating system 32 | viewer = '/usr/local/bin/pcl_viewer.app/Contents/MacOS/pcl_viewer'; 33 | 34 | 35 | pointfile = [tempname '.pcd']; 36 | 37 | if nargin < 2 38 | args = ''; 39 | end 40 | 41 | savepcd(pointfile, points); 42 | 43 | system(sprintf('head -20 %s', pointfile)); 44 | 45 | system(sprintf('%s %s %s &', ... 46 | viewer, pointfile, args)); 47 | 48 | pause(1) 49 | delete(pointfile); 50 | -------------------------------------------------------------------------------- /scripts/NYU_Depth_Dataset/v1/toolbox/.svn/text-base/README.svn-base: -------------------------------------------------------------------------------- 1 | NYU Depth Dataset Matlab Toolbox 2 | Authors: Nathan Silberman, Rob Fergus {silberman,fergus}@cs.nyu.edu 3 | 4 | *********************************** 5 | SYNCHRONIZING AND PROJECTING FRAMES 6 | *********************************** 7 | Since the RGB and Raw Depth frames are not produced synchronously, (a) they must 8 | be aligned in time and (b) the depth must be projected into the RGB image plane. 9 | The functions get_synched_frames.m and get_projected_depth.m have been provided 10 | to provide this functionality. 11 | 12 | File demo_synched_projected_frames.m provides a visualization of this process. 13 | 14 | ************************* 15 | RETRIEVING THE ACCEL DATA 16 | ************************* 17 | To compile the get_accel_data function, you must alter compile.m with the 18 | absolute location of the libFreenect include directory. Once compile, 19 | get_accel_data.mex* can be called to extract the accelerometer data from the 20 | *.a files in each scene dump directory. 21 | 22 | ******************* 23 | Running unit tests: 24 | ******************* 25 | To run the unit tests, you need the matlab xUnit framework on your path. It 26 | can be found here: http://www.mathworks.com/matlabcentral/fileexchange/22846 27 | 28 | Once xunit is on your path, you can run the tests as follows: 29 | 30 | >> cd [TOOLBOX_DIR] 31 | >> runtests 32 | 33 | -------------------------------------------------------------------------------- /scripts/NYU_Depth_Dataset/v1/toolbox/.svn/text-base/compile.m.svn-base: -------------------------------------------------------------------------------- 1 | libFreenectIncludeDir = '[Path to LibFreenect Include directory]'; 2 | eval(sprintf('mex -I%s get_accel_data.cpp', libFreenectIncludeDir)); 3 | 4 | -------------------------------------------------------------------------------- /scripts/NYU_Depth_Dataset/v1/toolbox/.svn/text-base/confusion_matrix.m.svn-base: -------------------------------------------------------------------------------- 1 | function C = confusion_matrix(labels, predictions, numClasses) 2 | % Creates a confusion matrix given a set of labels and predictions. 3 | % 4 | % C(i,j) = is the percentage of images from class i that 5 | % were classified as class j. 6 | % 7 | % C = confusionMatrix(truecategoruy, votedCategory); 8 | % 9 | % Inputs: 10 | % labels - a vector of discrete integer labels. The smallest label should be 11 | % no smaller than 1. 12 | % predictions - a vector of discrete integer predictions. The smallest 13 | % prediction should be no smaller than 1. 14 | % 15 | % Ouputs: 16 | % C - the confusion matrix. 17 | 18 | error(nargchk(2, 3, nargin)); 19 | 20 | if numel(labels) ~= numel(predictions) 21 | error('Oops. The number of labels and predictions must be equal.'); 22 | end 23 | 24 | % Flatten both in case one is a row and the other is a column vector. 25 | labels = labels(:); 26 | predictions = predictions(:); 27 | 28 | if nargin == 3 29 | n = numClasses; 30 | m = numClasses; 31 | else 32 | n = max(labels); 33 | m = max(predictions); 34 | end 35 | 36 | C = zeros([n m]); 37 | 38 | for i = 1:n 39 | for j = 1:m 40 | if sum(labels == i) > 0 41 | C(i,j) = sum((labels == i) .* (predictions == j)); % / sum(labels == i); 42 | end 43 | end 44 | end 45 | 46 | -------------------------------------------------------------------------------- /scripts/NYU_Depth_Dataset/v1/toolbox/.svn/text-base/demo_get_train_test_split.m.svn-base: -------------------------------------------------------------------------------- 1 | % Demo for 'get_train_test_split' which shows that images of the same scene 2 | % are never split across both train and test. 3 | 4 | PATH_TO_DATASET = '~/data/kinect/datasets/'; % Fill in here. 5 | 6 | load(sprintf('%s/nyu_depth_data_labeled_2011_05_31.mat', PATH_TO_DATASET), 'scenes'); 7 | 8 | [trainNdxs, testNdxs, trainScenes, testScenes] = get_train_test_split(scenes); 9 | 10 | fprintf('Training set size: %d.\n', numel(trainNdxs)); 11 | fprintf('Testing set size: %d.\n', numel(testNdxs)); 12 | fprintf('\n'); 13 | 14 | fprintf('Training Scenes: \n'); 15 | for ii = 1 : numel(trainScenes) 16 | fprintf(sprintf('%s\n', trainScenes{ii})); 17 | end 18 | 19 | fprintf('\n'); 20 | fprintf('Testing Scenes: \n'); 21 | for ii = 1 : numel(testScenes) 22 | fprintf(sprintf('%s\n', testScenes{ii})); 23 | end -------------------------------------------------------------------------------- /scripts/NYU_Depth_Dataset/v1/toolbox/.svn/text-base/demo_synched_projected_frames.m.svn-base: -------------------------------------------------------------------------------- 1 | % The directory where you extracted the raw dataset. 2 | datasetDir = '[PATH TO THE NYU DEPTH RAW DATASET]'; 3 | 4 | % The name of the scene to demo. 5 | sceneName = '[NAME OF A SCENE YOU WANT TO VIEW]'; 6 | 7 | % The absolute directory of the 8 | sceneDir = sprintf('%s/%s', datasetDir, sceneName); 9 | 10 | % Reads the list of frames. 11 | frameList = get_synched_frames(sceneDir); 12 | 13 | % Displays each pair of synchronized RGB and Depth frames. 14 | for ii = 1 : 15 : numel(frameList) 15 | imgRgb = imread([sceneDir '/' frameList(ii).rawRgbFilename]); 16 | imgDepthRaw = swapbytes(imread([sceneDir '/' frameList(ii).rawDepthFilename])); 17 | 18 | figure(1); 19 | % Show the RGB image. 20 | subplot(1,3,1); 21 | imagesc(imgRgb); 22 | axis off; 23 | axis equal; 24 | title('RGB'); 25 | 26 | % Show the Raw Depth image. 27 | subplot(1,3,2); 28 | imagesc(imgDepthRaw); 29 | axis off; 30 | axis equal; 31 | title('Raw Depth'); 32 | caxis([800 1100]); 33 | 34 | % Show the projected depth image. 35 | imgDepthProj = get_projected_depth(imgDepthRaw); 36 | subplot(1,3,3); 37 | imagesc(imgDepthProj); 38 | axis off; 39 | axis equal; 40 | title('Projected Depth'); 41 | 42 | pause(0.01); 43 | end 44 | -------------------------------------------------------------------------------- /scripts/NYU_Depth_Dataset/v1/toolbox/.svn/text-base/eval_seg.m.svn-base: -------------------------------------------------------------------------------- 1 | % Evaluates the accuracy of a given segmentation using pixel-level 2 | % accuracy. 3 | % 4 | % Args: 5 | % predictions - a HxW matrix of labels, where H and W are the height and 6 | % width of the image, respectively. 7 | % groundTruth - a HxW matrix of labels, where H and W are the height and 8 | % width of the image, respectively. 9 | % numClasses - the number of total classes in the experiment. 10 | function [accuracy, numCorrect, numLabeled, cm] = eval_seg(predictions, ... 11 | groundTruth, numClasses) 12 | 13 | numCorrect = nnz(predictions == groundTruth); 14 | numLabeled = nnz(groundTruth > 0); 15 | 16 | accuracy = numCorrect / numLabeled; 17 | 18 | cm = confusion_matrix(groundTruth(:), predictions(:), numClasses); 19 | end -------------------------------------------------------------------------------- /scripts/NYU_Depth_Dataset/v1/toolbox/.svn/text-base/get_accel_data.cpp.svn-base: -------------------------------------------------------------------------------- 1 | #include 2 | #include "mex.h" 3 | #include 4 | #include 5 | 6 | int get_data_size(FILE *fp) { 7 | int orig = ftell(fp); 8 | fseek(fp, 0L, SEEK_END); 9 | int out = ftell(fp); 10 | fseek(fp, orig, SEEK_SET); 11 | return out; 12 | } 13 | 14 | void mexFunction(int nlhs, mxArray* plhs[], const int nrhs, const mxArray* prhs[]) { 15 | if (nrhs != 1) { 16 | mexErrMsgTxt("Number of arguments must be exactly 1."); 17 | } else if (!mxIsChar(prhs[0])) { 18 | mexErrMsgTxt("Input must be a string."); 19 | } 20 | 21 | // get the length of the filename. 22 | mwSize filename_length = (mxGetM(prhs[0]) * mxGetN(prhs[0])) + 1; 23 | char *filename = mxArrayToString(prhs[0]); 24 | 25 | FILE* fp = fopen(filename, "r"); 26 | if (fp == NULL) { 27 | mexErrMsgIdAndTxt("filename:notFound", "file %s not found", filename); 28 | } 29 | 30 | int data_size = get_data_size(fp); 31 | if (data_size != sizeof(freenect_raw_tilt_state)) { 32 | mexErrMsgIdAndTxt("filename:notAccel", 33 | "file %s's size doesnt match freenect_raw_tilt_state.", filename); 34 | } 35 | 36 | freenect_raw_tilt_state state; 37 | fread(&state, sizeof(state), 1, fp); 38 | 39 | mwSize ndim = 2; 40 | const mwSize dim_size[] = {4, 1}; 41 | plhs[0] = mxCreateNumericArray(ndim, dim_size, mxDOUBLE_CLASS, mxREAL); 42 | double* output_data = (double*) mxGetData(plhs[0]); 43 | output_data[0] = state.accelerometer_x; 44 | output_data[1] = state.accelerometer_y; 45 | output_data[2] = state.accelerometer_z; 46 | output_data[3] = state.tilt_angle; 47 | 48 | fclose(fp); 49 | } 50 | -------------------------------------------------------------------------------- /scripts/NYU_Depth_Dataset/v1/toolbox/.svn/text-base/get_accel_data.m.svn-base: -------------------------------------------------------------------------------- 1 | % Returns the accelerometer data coming from the kinect. 2 | % 3 | % Args: 4 | % filename - the filename of the .dump file. 5 | % 6 | % Returns: 7 | % data - a 4x1 vector where the first three elements are the x, y, and z 8 | % components of the accelerometer and the fourth element is the 9 | % tilt angle. 10 | % 11 | % data = get_accel_data(filename); -------------------------------------------------------------------------------- /scripts/NYU_Depth_Dataset/v1/toolbox/.svn/text-base/get_projection_mask.m.svn-base: -------------------------------------------------------------------------------- 1 | % Gets a mask for the projected images that is most conservative with 2 | % regard the regions that maintain the original kinect signal. 3 | function mask = get_projection_mask() 4 | mask = false(480, 640); 5 | mask(45:470, 36:600) = 1; 6 | end -------------------------------------------------------------------------------- /scripts/NYU_Depth_Dataset/v1/toolbox/.svn/text-base/get_scene_counts.m.svn-base: -------------------------------------------------------------------------------- 1 | % Counts the number of images per scene and scene type. 2 | % 3 | % Args: 4 | % scens - cell array of 5 | % 6 | % Returns: 7 | % sceneCounts - a map from scene to the number of images in that scene. 8 | % sceneTypeCounts - a map from sceneType to the number of images in that 9 | % sceneType. 10 | function [sceneCounts, sceneTypeCounts] = get_scene_counts(scenes) 11 | sceneCounts = containers.Map(); 12 | sceneTypeCounts = containers.Map(); 13 | 14 | for ii = 1 : numel(scenes) 15 | scene = scenes{ii}; 16 | sceneType = get_scene_type_from_scene(scene); 17 | 18 | if ~isKey(sceneCounts, scene) 19 | sceneCounts(scene) = 0; 20 | end 21 | sceneCounts(scene) = sceneCounts(scene) + 1; 22 | 23 | if ~isKey(sceneTypeCounts, sceneType) 24 | sceneTypeCounts(sceneType) = 0; 25 | end 26 | sceneTypeCounts(sceneType) = sceneTypeCounts(sceneType) + 1; 27 | end 28 | end -------------------------------------------------------------------------------- /scripts/NYU_Depth_Dataset/v1/toolbox/.svn/text-base/get_scene_counts_as_perc.m.svn-base: -------------------------------------------------------------------------------- 1 | % Calculates the percentage (in terms of number of images) that each scene 2 | % makes up out of its scene type. 3 | % 4 | % Args: 5 | % sceneCounts - map from scene to image files per scene 6 | % sceneTypeCounts - map from sceneType to image files per sceneType 7 | % 8 | % Returns: 9 | % sceneCounts - map from scene to percentage of sceneType the scene makes 10 | % up (in terms of total image files). 11 | function sceneCounts = get_scene_counts_as_perc(sceneCounts, sceneTypeCounts) 12 | scenes = keys(sceneCounts); 13 | for ii = 1 : length(sceneCounts) 14 | scene = scenes{ii}; 15 | sceneType = get_scene_type_from_scene(scene); 16 | sceneCounts(scene) = sceneCounts(scene) / sceneTypeCounts(sceneType); 17 | end 18 | end -------------------------------------------------------------------------------- /scripts/NYU_Depth_Dataset/v1/toolbox/.svn/text-base/get_scene_type_from_scene.m.svn-base: -------------------------------------------------------------------------------- 1 | % Returns the scene type (living room, starbucks, subway, etc) from the 2 | % scene (living_room_0002k, office_0013, etc). 3 | % 4 | % Args: 5 | % scene - the scene name: [sceneType]_[sceneNumber] 6 | % 7 | % Returns: 8 | % sceneType - the name of the scene type. 9 | function sceneType = get_scene_type_from_scene(scene) 10 | ind = regexp(scene, '\d+\w?'); 11 | sceneType = scene(1:ind-2); 12 | end -------------------------------------------------------------------------------- /scripts/NYU_Depth_Dataset/v1/toolbox/.svn/text-base/test_eval_seg.m.svn-base: -------------------------------------------------------------------------------- 1 | function test_suite = test_eval_seg() 2 | initTestSuite; 3 | end 4 | 5 | function test_all_correct() 6 | numClasses = 5; 7 | groundTruth = randi(numClasses, [3 3]); 8 | predictions = groundTruth; 9 | 10 | [accuracy, numCorrect, numLabeled] = eval_seg(predictions, ... 11 | groundTruth, numClasses); 12 | assertEqual(accuracy, 1.0); 13 | assertEqual(numCorrect, 9); 14 | assertEqual(numLabeled, 9); 15 | end 16 | 17 | function test_all_incorrect() 18 | numClasses = 5; 19 | groundTruth = randi(numClasses, [3 3]); 20 | predictions = groundTruth + 1; 21 | 22 | [accuracy, numCorrect, numLabeled] = eval_seg(predictions, ... 23 | groundTruth, numClasses); 24 | assertEqual(accuracy, 0.0); 25 | assertEqual(numCorrect, 0); 26 | assertEqual(numLabeled, 9); 27 | end 28 | 29 | function test_some_correct() 30 | numClasses = 5; 31 | groundTruth = randi(numClasses, [3 3]); 32 | incorrect = logical(randi(2, [3 3]) - 1); 33 | predictions = groundTruth + incorrect; 34 | 35 | [accuracy, numCorrect, numLabeled] = eval_seg(predictions, ... 36 | groundTruth, numClasses); 37 | assertEqual(accuracy, nnz(~incorrect) / 9); 38 | assertEqual(numCorrect, 9-nnz(incorrect)); 39 | assertEqual(numLabeled, 9); 40 | end 41 | 42 | function test_some_correct_some_missing() 43 | numClasses = 3; 44 | groundTruth = [0 1 1; 45 | 2 0 1; 46 | 0 3 2]; 47 | predictions = [2 1 2; 48 | 2 3 1; 49 | 2 3 3]; 50 | [accuracy, numCorrect, numLabeled] = eval_seg(predictions, ... 51 | groundTruth, numClasses); 52 | assertEqual(accuracy, 4/6); 53 | assertEqual(numCorrect, 4); 54 | assertEqual(numLabeled, 6); 55 | end -------------------------------------------------------------------------------- /scripts/NYU_Depth_Dataset/v1/toolbox/.svn/text-base/test_get_scene_counts_as_perc.m.svn-base: -------------------------------------------------------------------------------- 1 | function test_suite = test_get_scene_counts_as_perc 2 | initTestSuite; 3 | end 4 | 5 | function test_with_canonical_filenames 6 | scenes = cell(10, 1); 7 | scenes{1} = 'bathroom_0001'; 8 | scenes{2} = 'bathroom_0002'; 9 | scenes{3} = 'bedroom_0002'; 10 | scenes{4} = 'bedroom_0003'; 11 | scenes{5} = 'living_room_0004'; 12 | scenes{6} = 'bathroom_0001'; 13 | scenes{7} = 'bathroom_0001'; 14 | scenes{8} = 'bedroom_0002'; 15 | scenes{9} = 'living_room_0004'; 16 | scenes{10} = 'living_room_0004'; 17 | [sceneCounts, sceneTypeCounts] = get_scene_counts(scenes); 18 | sceneCounts = get_scene_counts_as_perc(sceneCounts, sceneTypeCounts); 19 | 20 | assertEqual(length(sceneCounts), 5); 21 | assertEqual(sceneCounts('bathroom_0001'), 3/4); 22 | assertEqual(sceneCounts('bathroom_0002'), 1/4); 23 | assertEqual(sceneCounts('bedroom_0002'), 2/3); 24 | assertEqual(sceneCounts('bedroom_0003'), 1/3); 25 | assertEqual(sceneCounts('living_room_0004'), 3/3); 26 | end -------------------------------------------------------------------------------- /scripts/NYU_Depth_Dataset/v1/toolbox/.svn/text-base/test_get_scene_type_from_scene.m.svn-base: -------------------------------------------------------------------------------- 1 | function test_suite = test_get_scene_type_from_scene 2 | initTestSuite; 3 | end 4 | 5 | function test_with_simple_scene_name 6 | sceneType = get_scene_type_from_scene('hallway_0001'); 7 | assertEqual(sceneType, 'hallway'); 8 | end 9 | 10 | function test_with_complex_scene_name 11 | sceneType = get_scene_type_from_scene('dept_store_0002'); 12 | assertEqual(sceneType, 'dept_store'); 13 | end 14 | 15 | function test_with_complex_scene_name2 16 | sceneType = get_scene_type_from_scene('living_room_0001b'); 17 | assertEqual(sceneType, 'living_room'); 18 | end -------------------------------------------------------------------------------- /scripts/NYU_Depth_Dataset/v1/toolbox/README: -------------------------------------------------------------------------------- 1 | NYU Depth Dataset Matlab Toolbox 2 | Authors: Nathan Silberman, Rob Fergus {silberman,fergus}@cs.nyu.edu 3 | 4 | *********************************** 5 | SYNCHRONIZING AND PROJECTING FRAMES 6 | *********************************** 7 | Since the RGB and Raw Depth frames are not produced synchronously, (a) they must 8 | be aligned in time and (b) the depth must be projected into the RGB image plane. 9 | The functions get_synched_frames.m and get_projected_depth.m have been provided 10 | to provide this functionality. 11 | 12 | File demo_synched_projected_frames.m provides a visualization of this process. 13 | 14 | ************************* 15 | RETRIEVING THE ACCEL DATA 16 | ************************* 17 | To compile the get_accel_data function, you must alter compile.m with the 18 | absolute location of the libFreenect include directory. Once compile, 19 | get_accel_data.mex* can be called to extract the accelerometer data from the 20 | *.a files in each scene dump directory. 21 | 22 | ******************* 23 | Running unit tests: 24 | ******************* 25 | To run the unit tests, you need the matlab xUnit framework on your path. It 26 | can be found here: http://www.mathworks.com/matlabcentral/fileexchange/22846 27 | 28 | Once xunit is on your path, you can run the tests as follows: 29 | 30 | >> cd [TOOLBOX_DIR] 31 | >> runtests 32 | 33 | -------------------------------------------------------------------------------- /scripts/NYU_Depth_Dataset/v1/toolbox/compile.m: -------------------------------------------------------------------------------- 1 | libFreenectIncludeDir = '[Path to LibFreenect Include directory]'; 2 | eval(sprintf('mex -I%s get_accel_data.cpp', libFreenectIncludeDir)); 3 | 4 | -------------------------------------------------------------------------------- /scripts/NYU_Depth_Dataset/v1/toolbox/confusion_matrix.m: -------------------------------------------------------------------------------- 1 | function C = confusion_matrix(labels, predictions, numClasses) 2 | % Creates a confusion matrix given a set of labels and predictions. 3 | % 4 | % C(i,j) = is the percentage of images from class i that 5 | % were classified as class j. 6 | % 7 | % C = confusionMatrix(truecategoruy, votedCategory); 8 | % 9 | % Inputs: 10 | % labels - a vector of discrete integer labels. The smallest label should be 11 | % no smaller than 1. 12 | % predictions - a vector of discrete integer predictions. The smallest 13 | % prediction should be no smaller than 1. 14 | % 15 | % Ouputs: 16 | % C - the confusion matrix. 17 | 18 | error(nargchk(2, 3, nargin)); 19 | 20 | if numel(labels) ~= numel(predictions) 21 | error('Oops. The number of labels and predictions must be equal.'); 22 | end 23 | 24 | % Flatten both in case one is a row and the other is a column vector. 25 | labels = labels(:); 26 | predictions = predictions(:); 27 | 28 | if nargin == 3 29 | n = numClasses; 30 | m = numClasses; 31 | else 32 | n = max(labels); 33 | m = max(predictions); 34 | end 35 | 36 | C = zeros([n m]); 37 | 38 | for i = 1:n 39 | for j = 1:m 40 | if sum(labels == i) > 0 41 | C(i,j) = sum((labels == i) .* (predictions == j)); 42 | end 43 | end 44 | end 45 | 46 | -------------------------------------------------------------------------------- /scripts/NYU_Depth_Dataset/v1/toolbox/demo_get_train_test_split.m: -------------------------------------------------------------------------------- 1 | % Demo for 'get_train_test_split' which shows that images of the same scene 2 | % are never split across both train and test. 3 | 4 | PATH_TO_DATASET = '~/data/kinect/datasets/'; % Fill in here. 5 | 6 | load(sprintf('%s/nyu_depth_data_labeled_2011_05_31.mat', PATH_TO_DATASET), 'scenes'); 7 | 8 | [trainNdxs, testNdxs, trainScenes, testScenes] = get_train_test_split(scenes); 9 | 10 | fprintf('Training set size: %d.\n', numel(trainNdxs)); 11 | fprintf('Testing set size: %d.\n', numel(testNdxs)); 12 | fprintf('\n'); 13 | 14 | fprintf('Training Scenes: \n'); 15 | for ii = 1 : numel(trainScenes) 16 | fprintf(sprintf('%s\n', trainScenes{ii})); 17 | end 18 | 19 | fprintf('\n'); 20 | fprintf('Testing Scenes: \n'); 21 | for ii = 1 : numel(testScenes) 22 | fprintf(sprintf('%s\n', testScenes{ii})); 23 | end -------------------------------------------------------------------------------- /scripts/NYU_Depth_Dataset/v1/toolbox/demo_synched_projected_frames.m: -------------------------------------------------------------------------------- 1 | % The directory where you extracted the raw dataset. 2 | datasetDir = '[PATH TO THE NYU DEPTH RAW DATASET]'; 3 | 4 | % The name of the scene to demo. 5 | sceneName = '[NAME OF A SCENE YOU WANT TO VIEW]'; 6 | 7 | % The absolute directory of the 8 | sceneDir = sprintf('%s/%s', datasetDir, sceneName); 9 | 10 | % Reads the list of frames. 11 | frameList = get_synched_frames(sceneDir); 12 | 13 | % Displays each pair of synchronized RGB and Depth frames. 14 | for ii = 1 : 15 : numel(frameList) 15 | imgRgb = imread([sceneDir '/' frameList(ii).rawRgbFilename]); 16 | imgDepthRaw = swapbytes(imread([sceneDir '/' frameList(ii).rawDepthFilename])); 17 | 18 | figure(1); 19 | % Show the RGB image. 20 | subplot(1,3,1); 21 | imagesc(imgRgb); 22 | axis off; 23 | axis equal; 24 | title('RGB'); 25 | 26 | % Show the Raw Depth image. 27 | subplot(1,3,2); 28 | imagesc(imgDepthRaw); 29 | axis off; 30 | axis equal; 31 | title('Raw Depth'); 32 | caxis([800 1100]); 33 | 34 | % Show the projected depth image. 35 | imgDepthProj = get_projected_depth(imgDepthRaw); 36 | subplot(1,3,3); 37 | imagesc(imgDepthProj); 38 | axis off; 39 | axis equal; 40 | title('Projected Depth'); 41 | 42 | pause(0.01); 43 | end 44 | -------------------------------------------------------------------------------- /scripts/NYU_Depth_Dataset/v1/toolbox/eval_seg.m: -------------------------------------------------------------------------------- 1 | % Evaluates the accuracy of a given segmentation using pixel-level 2 | % accuracy. 3 | % 4 | % Args: 5 | % predictions - a HxW matrix of labels, where H and W are the height and 6 | % width of the image, respectively. 7 | % groundTruth - a HxW matrix of labels, where H and W are the height and 8 | % width of the image, respectively. 9 | % numClasses - the number of total classes in the experiment. 10 | function [accuracy, numCorrect, numLabeled, cm] = eval_seg(predictions, ... 11 | groundTruth, numClasses) 12 | 13 | numCorrect = nnz(predictions == groundTruth); 14 | numLabeled = nnz(groundTruth > 0); 15 | 16 | accuracy = numCorrect / numLabeled; 17 | 18 | cm = confusion_matrix(groundTruth(:), predictions(:), numClasses); 19 | end -------------------------------------------------------------------------------- /scripts/NYU_Depth_Dataset/v1/toolbox/get_accel_data.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "mex.h" 3 | #include 4 | #include 5 | 6 | int get_data_size(FILE *fp) { 7 | int orig = ftell(fp); 8 | fseek(fp, 0L, SEEK_END); 9 | int out = ftell(fp); 10 | fseek(fp, orig, SEEK_SET); 11 | return out; 12 | } 13 | 14 | void mexFunction(int nlhs, mxArray* plhs[], const int nrhs, const mxArray* prhs[]) { 15 | if (nrhs != 1) { 16 | mexErrMsgTxt("Number of arguments must be exactly 1."); 17 | } else if (!mxIsChar(prhs[0])) { 18 | mexErrMsgTxt("Input must be a string."); 19 | } 20 | 21 | // get the length of the filename. 22 | mwSize filename_length = (mxGetM(prhs[0]) * mxGetN(prhs[0])) + 1; 23 | char *filename = mxArrayToString(prhs[0]); 24 | 25 | FILE* fp = fopen(filename, "r"); 26 | if (fp == NULL) { 27 | mexErrMsgIdAndTxt("filename:notFound", "file %s not found", filename); 28 | } 29 | 30 | int data_size = get_data_size(fp); 31 | if (data_size != sizeof(freenect_raw_tilt_state)) { 32 | mexErrMsgIdAndTxt("filename:notAccel", 33 | "file %s's size doesnt match freenect_raw_tilt_state.", filename); 34 | } 35 | 36 | freenect_raw_tilt_state state; 37 | fread(&state, sizeof(state), 1, fp); 38 | 39 | mwSize ndim = 2; 40 | const mwSize dim_size[] = {4, 1}; 41 | plhs[0] = mxCreateNumericArray(ndim, dim_size, mxDOUBLE_CLASS, mxREAL); 42 | double* output_data = (double*) mxGetData(plhs[0]); 43 | output_data[0] = state.accelerometer_x; 44 | output_data[1] = state.accelerometer_y; 45 | output_data[2] = state.accelerometer_z; 46 | output_data[3] = state.tilt_angle; 47 | 48 | fclose(fp); 49 | } 50 | -------------------------------------------------------------------------------- /scripts/NYU_Depth_Dataset/v1/toolbox/get_accel_data.m: -------------------------------------------------------------------------------- 1 | % Returns the accelerometer data coming from the kinect. 2 | % 3 | % Args: 4 | % filename - the filename of the .dump file. 5 | % 6 | % Returns: 7 | % data - a 4x1 vector where the first three elements are the x, y, and z 8 | % components of the accelerometer and the fourth element is the 9 | % tilt angle. 10 | % 11 | % data = get_accel_data(filename); -------------------------------------------------------------------------------- /scripts/NYU_Depth_Dataset/v1/toolbox/get_accel_data.mexa64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strands-project/v4r/7cb817e05cb9d99cb2f68db009c27d7144d07f09/scripts/NYU_Depth_Dataset/v1/toolbox/get_accel_data.mexa64 -------------------------------------------------------------------------------- /scripts/NYU_Depth_Dataset/v1/toolbox/get_projection_mask.m: -------------------------------------------------------------------------------- 1 | % Gets a mask for the projected images that is most conservative with 2 | % regard the regions that maintain the original kinect signal. 3 | function mask = get_projection_mask() 4 | mask = false(480, 640); 5 | mask(45:470, 36:600) = 1; 6 | end -------------------------------------------------------------------------------- /scripts/NYU_Depth_Dataset/v1/toolbox/get_scene_counts.m: -------------------------------------------------------------------------------- 1 | % Counts the number of images per scene and scene type. 2 | % 3 | % Args: 4 | % scens - cell array of 5 | % 6 | % Returns: 7 | % sceneCounts - a map from scene to the number of images in that scene. 8 | % sceneTypeCounts - a map from sceneType to the number of images in that 9 | % sceneType. 10 | function [sceneCounts, sceneTypeCounts] = get_scene_counts(scenes) 11 | sceneCounts = containers.Map(); 12 | sceneTypeCounts = containers.Map(); 13 | 14 | for ii = 1 : numel(scenes) 15 | scene = scenes{ii}; 16 | sceneType = get_scene_type_from_scene(scene); 17 | 18 | if ~isKey(sceneCounts, scene) 19 | sceneCounts(scene) = 0; 20 | end 21 | sceneCounts(scene) = sceneCounts(scene) + 1; 22 | 23 | if ~isKey(sceneTypeCounts, sceneType) 24 | sceneTypeCounts(sceneType) = 0; 25 | end 26 | sceneTypeCounts(sceneType) = sceneTypeCounts(sceneType) + 1; 27 | end 28 | end -------------------------------------------------------------------------------- /scripts/NYU_Depth_Dataset/v1/toolbox/get_scene_counts_as_perc.m: -------------------------------------------------------------------------------- 1 | % Calculates the percentage (in terms of number of images) that each scene 2 | % makes up out of its scene type. 3 | % 4 | % Args: 5 | % sceneCounts - map from scene to image files per scene 6 | % sceneTypeCounts - map from sceneType to image files per sceneType 7 | % 8 | % Returns: 9 | % sceneCounts - map from scene to percentage of sceneType the scene makes 10 | % up (in terms of total image files). 11 | function sceneCounts = get_scene_counts_as_perc(sceneCounts, sceneTypeCounts) 12 | scenes = keys(sceneCounts); 13 | for ii = 1 : length(sceneCounts) 14 | scene = scenes{ii}; 15 | sceneType = get_scene_type_from_scene(scene); 16 | sceneCounts(scene) = sceneCounts(scene) / sceneTypeCounts(sceneType); 17 | end 18 | end -------------------------------------------------------------------------------- /scripts/NYU_Depth_Dataset/v1/toolbox/get_scene_type_from_scene.m: -------------------------------------------------------------------------------- 1 | % Returns the scene type (living room, starbucks, subway, etc) from the 2 | % scene (living_room_0002k, office_0013, etc). 3 | % 4 | % Args: 5 | % scene - the scene name: [sceneType]_[sceneNumber] 6 | % 7 | % Returns: 8 | % sceneType - the name of the scene type. 9 | function sceneType = get_scene_type_from_scene(scene) 10 | ind = regexp(scene, '\d+\w?'); 11 | sceneType = scene(1:ind-2); 12 | end -------------------------------------------------------------------------------- /scripts/NYU_Depth_Dataset/v1/toolbox/maplabels.m: -------------------------------------------------------------------------------- 1 | function mapped = maplabels(origlbl, mapping) 2 | 3 | mapped = origlbl; 4 | 5 | for i=1:length(mapping) 6 | idx = (origlbl == i); 7 | mapped(idx) = mapping(i)-1; 8 | end 9 | -------------------------------------------------------------------------------- /scripts/NYU_Depth_Dataset/v1/toolbox/rgb_plane2rgb_world.m: -------------------------------------------------------------------------------- 1 | function points3d = rgb_plane2rgb_world(imgDepth) 2 | % Color camera parameters 3 | fx_rgb = 5.1930334103339817e+02; 4 | fy_rgb = 5.1816401430246583e+02; 5 | cx_rgb = 3.2850951551345941e+02; 6 | cy_rgb = 2.5282555217253503e+02; 7 | 8 | [H, W] = size(imgDepth); 9 | 10 | % Make the original consistent with the camera location: 11 | [xx, yy] = meshgrid(1:W, 1:H); 12 | 13 | x3 = (xx - cx_rgb) .* imgDepth / fx_rgb; 14 | y3 = (yy - cy_rgb) .* imgDepth / fy_rgb; 15 | z3 = imgDepth; 16 | 17 | points3d = [x3(:) y3(:) z3(:)]; 18 | end 19 | -------------------------------------------------------------------------------- /scripts/NYU_Depth_Dataset/v1/toolbox/test_eval_seg.m: -------------------------------------------------------------------------------- 1 | function test_suite = test_eval_seg() 2 | initTestSuite; 3 | end 4 | 5 | function test_all_correct() 6 | numClasses = 5; 7 | groundTruth = randi(numClasses, [3 3]); 8 | predictions = groundTruth; 9 | 10 | [accuracy, numCorrect, numLabeled] = eval_seg(predictions, ... 11 | groundTruth, numClasses); 12 | assertEqual(accuracy, 1.0); 13 | assertEqual(numCorrect, 9); 14 | assertEqual(numLabeled, 9); 15 | end 16 | 17 | function test_all_incorrect() 18 | numClasses = 5; 19 | groundTruth = randi(numClasses, [3 3]); 20 | predictions = groundTruth + 1; 21 | 22 | [accuracy, numCorrect, numLabeled] = eval_seg(predictions, ... 23 | groundTruth, numClasses); 24 | assertEqual(accuracy, 0.0); 25 | assertEqual(numCorrect, 0); 26 | assertEqual(numLabeled, 9); 27 | end 28 | 29 | function test_some_correct() 30 | numClasses = 5; 31 | groundTruth = randi(numClasses, [3 3]); 32 | incorrect = logical(randi(2, [3 3]) - 1); 33 | predictions = groundTruth + incorrect; 34 | 35 | [accuracy, numCorrect, numLabeled] = eval_seg(predictions, ... 36 | groundTruth, numClasses); 37 | assertEqual(accuracy, nnz(~incorrect) / 9); 38 | assertEqual(numCorrect, 9-nnz(incorrect)); 39 | assertEqual(numLabeled, 9); 40 | end 41 | 42 | function test_some_correct_some_missing() 43 | numClasses = 3; 44 | groundTruth = [0 1 1; 45 | 2 0 1; 46 | 0 3 2]; 47 | predictions = [2 1 2; 48 | 2 3 1; 49 | 2 3 3]; 50 | [accuracy, numCorrect, numLabeled] = eval_seg(predictions, ... 51 | groundTruth, numClasses); 52 | assertEqual(accuracy, 4/6); 53 | assertEqual(numCorrect, 4); 54 | assertEqual(numLabeled, 6); 55 | end -------------------------------------------------------------------------------- /scripts/NYU_Depth_Dataset/v1/toolbox/test_get_scene_counts_as_perc.m: -------------------------------------------------------------------------------- 1 | function test_suite = test_get_scene_counts_as_perc 2 | initTestSuite; 3 | end 4 | 5 | function test_with_canonical_filenames 6 | scenes = cell(10, 1); 7 | scenes{1} = 'bathroom_0001'; 8 | scenes{2} = 'bathroom_0002'; 9 | scenes{3} = 'bedroom_0002'; 10 | scenes{4} = 'bedroom_0003'; 11 | scenes{5} = 'living_room_0004'; 12 | scenes{6} = 'bathroom_0001'; 13 | scenes{7} = 'bathroom_0001'; 14 | scenes{8} = 'bedroom_0002'; 15 | scenes{9} = 'living_room_0004'; 16 | scenes{10} = 'living_room_0004'; 17 | [sceneCounts, sceneTypeCounts] = get_scene_counts(scenes); 18 | sceneCounts = get_scene_counts_as_perc(sceneCounts, sceneTypeCounts); 19 | 20 | assertEqual(length(sceneCounts), 5); 21 | assertEqual(sceneCounts('bathroom_0001'), 3/4); 22 | assertEqual(sceneCounts('bathroom_0002'), 1/4); 23 | assertEqual(sceneCounts('bedroom_0002'), 2/3); 24 | assertEqual(sceneCounts('bedroom_0003'), 1/3); 25 | assertEqual(sceneCounts('living_room_0004'), 3/3); 26 | end -------------------------------------------------------------------------------- /scripts/NYU_Depth_Dataset/v1/toolbox/test_get_scene_type_from_scene.m: -------------------------------------------------------------------------------- 1 | function test_suite = test_get_scene_type_from_scene 2 | initTestSuite; 3 | end 4 | 5 | function test_with_simple_scene_name 6 | sceneType = get_scene_type_from_scene('hallway_0001'); 7 | assertEqual(sceneType, 'hallway'); 8 | end 9 | 10 | function test_with_complex_scene_name 11 | sceneType = get_scene_type_from_scene('dept_store_0002'); 12 | assertEqual(sceneType, 'dept_store'); 13 | end 14 | 15 | function test_with_complex_scene_name2 16 | sceneType = get_scene_type_from_scene('living_room_0001b'); 17 | assertEqual(sceneType, 'living_room'); 18 | end -------------------------------------------------------------------------------- /scripts/NYU_Depth_Dataset/v1/uwrite/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strands-project/v4r/7cb817e05cb9d99cb2f68db009c27d7144d07f09/scripts/NYU_Depth_Dataset/v1/uwrite/.DS_Store -------------------------------------------------------------------------------- /scripts/NYU_Depth_Dataset/v1/uwrite/README: -------------------------------------------------------------------------------- 1 | UREAD/UWRITE are like FREAD/FWRITE except that they operate on arrays 2 | in memory. 3 | 4 | A=UWRITE(D, PREC) will create a uint8 array A from the double array D. 5 | The format of the binary data in A is determined by PREC (one of 6 | uint8, uint16, uint32, int8 int16, int32, float32, float64, or 7 | double). The size of A is dependent on the precision PREC. 8 | 9 | D=UREAD(A, N, PREC) will read the uint8 array A and return N values 10 | into D. The data in A are assumed to be in the format of PREC (see 11 | UWRITE for supported formats). 12 | 13 | Installation: 14 | 15 | 1. Install the files, creating directory ``uwrite'': 16 | gunzip -c uwrite.tar.gz | tar -xvf - 17 | 18 | 2. Add the directory to your matlab path: 19 | path(path, '/uwrite'); 20 | 21 | 3. Set up the MEX compiler following the instructions supplied by 22 | Mathworks: 23 | mex -setup 24 | 25 | 4. Compile the C files: 26 | cd /uwrite 27 | mex uread.c 28 | mex uwrite.c 29 | 30 | Usage: 31 | 32 | 1. Add the directory to your matlab path: 33 | path(path, '/uwrite'); 34 | 35 | 2. ``help uread'' and ``help uwrite'' will give instructions. Also 36 | look at the source code in uread.c and uwrite.c 37 | 38 | If you find a bug please let me know. 39 | 40 | Thanks, 41 | Sridhar Anandakrishnan 42 | sak@essc.psu.edu 43 | 44 | 45 | -------------------------------------------------------------------------------- /scripts/NYU_Depth_Dataset/v1/uwrite/uwrite.m: -------------------------------------------------------------------------------- 1 | %UWRITE Write binary data to char vector. 2 | % S = UWRITE(A,PRECISION) writes the elements of matrix A 3 | % to a char column vector S, translating MATLAB values to the specified 4 | % precision. The data are written in column order. 5 | % 6 | % PRECISION controls the form and size of the result. See the list 7 | % of allowed precisions under UREAD. 'bitN' and 'ubitN' are not supported. 8 | % 9 | % For example, 10 | % 11 | % s=uwrite(magic(5),'int32') 12 | % 13 | % creates a 100-byte uint8 column vector S, containing the 25 elements of the 14 | % 5-by-5 magic square, stored as 4-byte integers. 15 | % 16 | % See also UREAD, FWRITE, FREAD, FPRINTF, SAVE, DIARY. 17 | % 18 | % Copyright (c) 2002 Sridhar Anandakrishnan, sak@essc.psu.edu 19 | -------------------------------------------------------------------------------- /scripts/NYU_Depth_Dataset/v2/mat2pcl/license.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013, Peter Corke 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are 6 | met: 7 | 8 | * Redistributions of source code must retain the above copyright 9 | notice, this list of conditions and the following disclaimer. 10 | * Redistributions in binary form must reproduce the above copyright 11 | notice, this list of conditions and the following disclaimer in 12 | the documentation and/or other materials provided with the distribution 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 18 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 19 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 20 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 21 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 22 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 23 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 24 | POSSIBILITY OF SUCH DAMAGE. 25 | -------------------------------------------------------------------------------- /scripts/NYU_Depth_Dataset/v2/mat2pcl/pclviewer.m: -------------------------------------------------------------------------------- 1 | %PCLVIEWER View a point cloud using PCL 2 | % 3 | % PCLVIEWER(P) writes the point cloud P (MxN) to a temporary file and invokes 4 | % the PCL point cloud viewer for fast display and visualization. The columns of P 5 | % represent the 3D points. 6 | % 7 | % If M=3 then the rows are x, y, z. 8 | % If M=6 then the rows are x, y, z, R, G, B where R,G,B are in the range 0 9 | % to 1. 10 | % 11 | % PCLVIEWER(P, ARGS) as above but the optional arguments ARGS are passed to the 12 | % PCL viewer. For example: 13 | % 14 | % pclviewer( rand(3,1000), '-ps 2 -ax 1' ) 15 | % 16 | % Notes:: 17 | % - Only the "x y z" and "x y z rgb" field formats are currently supported. 18 | % - The file is written in ascii format. 19 | % - When viewing colored point clouds in pcl_viewer remember to toggle to 20 | % 21 | % See also savepcd, lspcd, readpcd. 22 | % 23 | % Copyright (C) 2013, by Peter I. Corke 24 | 25 | % TODO 26 | % - add color 27 | 28 | 29 | function pclviewer(points, args) 30 | 31 | % change the next line to suit your operating system 32 | viewer = '/usr/local/bin/pcl_viewer.app/Contents/MacOS/pcl_viewer'; 33 | 34 | 35 | pointfile = [tempname '.pcd']; 36 | 37 | if nargin < 2 38 | args = ''; 39 | end 40 | 41 | savepcd(pointfile, points); 42 | 43 | system(sprintf('head -20 %s', pointfile)); 44 | 45 | system(sprintf('%s %s %s &', ... 46 | viewer, pointfile, args)); 47 | 48 | pause(1) 49 | delete(pointfile); 50 | -------------------------------------------------------------------------------- /scripts/NYU_Depth_Dataset/v2/toolbox/README: -------------------------------------------------------------------------------- 1 | NYU Depth V2 Dataset Matlab Toolbox 2 | Authors: Nathan Silberman, Pushmeet Kohli, Derek Hoiem, Rob Fergus 3 | 4 | ************************* 5 | RETRIEVING THE ACCEL DATA 6 | ************************* 7 | To compile the get_accel_data function, you must alter compile.m with the 8 | absolute location of the libFreenect include directory. Once compile, 9 | get_accel_data.mex* can be called to extract the accelerometer data from the 10 | *.a files in each scene dump directory. 11 | 12 | -------------------------------------------------------------------------------- /scripts/NYU_Depth_Dataset/v2/toolbox/camera_params.m: -------------------------------------------------------------------------------- 1 | % Calibrated using the RGBDemo Calibration tool: 2 | % http://labs.manctl.com/rgbdemo/ 3 | % 4 | 5 | % The maximum depth used, in meters. 6 | maxDepth = 10; 7 | 8 | % RGB Intrinsic Parameters 9 | fx_rgb = 5.1885790117450188e+02; 10 | fy_rgb = 5.1946961112127485e+02; 11 | cx_rgb = 3.2558244941119034e+02; 12 | cy_rgb = 2.5373616633400465e+02; 13 | 14 | % RGB Distortion Parameters 15 | k1_rgb = 2.0796615318809061e-01; 16 | k2_rgb = -5.8613825163911781e-01; 17 | p1_rgb = 7.2231363135888329e-04; 18 | p2_rgb = 1.0479627195765181e-03; 19 | k3_rgb = 4.9856986684705107e-01; 20 | 21 | % Depth Intrinsic Parameters 22 | fx_d = 5.8262448167737955e+02; 23 | fy_d = 5.8269103270988637e+02; 24 | cx_d = 3.1304475870804731e+02; 25 | cy_d = 2.3844389626620386e+02; 26 | 27 | % RGB Distortion Parameters 28 | k1_d = -9.9897236553084481e-02; 29 | k2_d = 3.9065324602765344e-01; 30 | p1_d = 1.9290592870229277e-03; 31 | p2_d = -1.9422022475975055e-03; 32 | k3_d = -5.1031725053400578e-01; 33 | 34 | % Rotation 35 | R = -[ 9.9997798940829263e-01, 5.0518419386157446e-03, ... 36 | 4.3011152014118693e-03, -5.0359919480810989e-03, ... 37 | 9.9998051861143999e-01, -3.6879781309514218e-03, ... 38 | -4.3196624923060242e-03, 3.6662365748484798e-03, ... 39 | 9.9998394948385538e-01 ]; 40 | 41 | R = reshape(R, [3 3]); 42 | R = inv(R'); 43 | 44 | % 3D Translation 45 | t_x = 2.5031875059141302e-02; 46 | t_z = -2.9342312935846411e-04; 47 | t_y = 6.6238747008330102e-04; 48 | 49 | % Parameters for making depth absolute. 50 | depthParam1 = 351.3; 51 | depthParam2 = 1092.5; 52 | -------------------------------------------------------------------------------- /scripts/NYU_Depth_Dataset/v2/toolbox/cbf.h: -------------------------------------------------------------------------------- 1 | #ifndef CBF_H_ 2 | #define CBF_H_ 3 | 4 | #include 5 | 6 | namespace cbf { 7 | 8 | // Filters the given depth image using a Cross Bilateral Filter. 9 | // 10 | // Args: 11 | // height - height of the images. 12 | // width - width of the images. 13 | // depth - HxW row-major ordered matrix. 14 | // intensity - HxW row-major ordered matrix. 15 | // mask - HxW row-major ordered matrix. 16 | // result - HxW row-major ordered matrix. 17 | // num_scales - the number of scales at which to perform the filtering. 18 | // sigma_s - the space sigma (in pixels) 19 | // sigma_r - the range sigma (in intensity values, 0-1) 20 | void cbf(int height, int width, uint8_t* depth, uint8_t* intensity, 21 | bool* mask, uint8_t* result, unsigned num_scales, double* sigma_s, 22 | double* sigma_r); 23 | 24 | } // namespace 25 | 26 | #endif // CBF_H_ 27 | -------------------------------------------------------------------------------- /scripts/NYU_Depth_Dataset/v2/toolbox/cbf_windows.h: -------------------------------------------------------------------------------- 1 | #ifndef CBF_H_ 2 | #define CBF_H_ 3 | 4 | #define NUM_SCALES 3 5 | #define IMG_HEIGHT 427 6 | #define IMG_WIDTH 561 7 | 8 | typedef unsigned char uint8_t; 9 | 10 | namespace cbf { 11 | 12 | // Filters the given depth image using a Cross Bilateral Filter. 13 | // 14 | // Args: 15 | // depth - HxW row-major ordered matrix. 16 | // intensity - HxW row-major ordered matrix. 17 | // mask - HxW row-major ordered matrix. 18 | // result - HxW row-major ordered matrix. 19 | // sigma_s - the space sigma (in pixels) 20 | // sigma_r - the range sigma (in intensity values, 0-1) 21 | void cbf(uint8_t* depth, uint8_t* intensity, 22 | bool* mask, uint8_t* result, double* sigma_s, 23 | double* sigma_r); 24 | 25 | } // namespace 26 | 27 | #endif // CBF_H_ 28 | -------------------------------------------------------------------------------- /scripts/NYU_Depth_Dataset/v2/toolbox/compile.m: -------------------------------------------------------------------------------- 1 | libFreenectIncludeDir = '[Path to LibFreenect Include directory]'; 2 | eval(sprintf('mex -I%s get_accel_data.cpp', libFreenectIncludeDir)); 3 | 4 | % Use this for linux\mac. 5 | if ispc 6 | mex mex_cbf_windows.cpp cbf_windows.cpp 7 | else 8 | mex mex_cbf.cpp cbf.cpp 9 | end -------------------------------------------------------------------------------- /scripts/NYU_Depth_Dataset/v2/toolbox/crop_image.m: -------------------------------------------------------------------------------- 1 | % Crops the given image to use only the portion where the projected depth 2 | % image exists. 3 | % 4 | % Args: 5 | % img - either a HxW image or a HxWxD image. 6 | % 7 | % Returns: 8 | % img - a cropped version of the image. 9 | function img = crop_image(img) 10 | [mask, sz] = get_projection_mask(); 11 | switch ndims(img) 12 | case 2 13 | img = reshape(img(mask), sz); 14 | case 3 15 | D = size(img, 3); 16 | img = reshape(img, [480*640 D]); 17 | img = reshape(img(mask,:), [sz D]); 18 | otherwise 19 | error('not supported'); 20 | end 21 | end -------------------------------------------------------------------------------- /scripts/NYU_Depth_Dataset/v2/toolbox/demo_fill_depth_cross_bf_test.m: -------------------------------------------------------------------------------- 1 | % Demo's the in-painting function fill_depth_cross_bf.m 2 | 3 | DATASET_PATH = '~/data1/kinect/spatial_relations_data/labeled_data.mat'; 4 | 5 | load(DATASET_PATH, 'images', 'rawDepths'); 6 | 7 | %% 8 | imageInd = 1; 9 | 10 | imgRgb = images(:,:,:,imageInd); 11 | imgDepthAbs = rawDepths(:,:,imageInd); 12 | 13 | % Crop the images to include the areas where we have depth information. 14 | imgRgb = crop_image(imgRgb); 15 | imgDepthAbs = crop_image(imgDepthAbs); 16 | 17 | imgDepthFilled = fill_depth_cross_bf(imgRgb, double(imgDepthAbs)); 18 | 19 | figure(1); 20 | subplot(1,3,1); imagesc(imgRgb); 21 | subplot(1,3,2); imagesc(imgDepthAbs); 22 | subplot(1,3,3); imagesc(imgDepthFilled); -------------------------------------------------------------------------------- /scripts/NYU_Depth_Dataset/v2/toolbox/demo_project_depth_map.m: -------------------------------------------------------------------------------- 1 | % Demos the use of project_depth_map.m 2 | 3 | % The location of the RAW dataset. 4 | CLIPS_DIR = '[]'; 5 | 6 | % The path to the labeled dataset. 7 | LABELED_DATASET_PATH = '[]'; 8 | 9 | load(LABELED_DATASET_PATH, 'rawDepthFilenames', 'rawRgbFilenames'); 10 | 11 | %% Load a pair of frames and align them. 12 | imgRgb = imread(sprintf('%s/%s', CLIPS_DIR, rawRgbFilenames{1})); 13 | 14 | imgDepth = imread(sprintf('%s/%s', CLIPS_DIR, rawDepthFilenames{1})); 15 | imgDepth = swapbytes(imgDepth); 16 | 17 | [imgDepth2, imgRgb2] = project_depth_map(imgDepth, imgRgb); 18 | 19 | %% Now visualize the pair before and after alignment. 20 | imgDepthAbsBefore = depth_rel2depth_abs(double(imgDepth)); 21 | imgOverlayBefore = get_rgb_depth_overlay(imgRgb, imgDepthAbsBefore); 22 | 23 | imgOverlayAfter = get_rgb_depth_overlay(imgRgb2, imgDepth2); 24 | 25 | figure; 26 | subplot(1,2,1); 27 | imagesc(crop_image(imgOverlayBefore)); 28 | title('Before projection'); 29 | 30 | subplot(1,2,2); 31 | imagesc(crop_image(imgOverlayAfter)); 32 | title('After projection'); -------------------------------------------------------------------------------- /scripts/NYU_Depth_Dataset/v2/toolbox/demo_synched_projected_frames.m: -------------------------------------------------------------------------------- 1 | % The directory where you extracted the raw dataset. 2 | datasetDir = '[PATH TO THE NYU DEPTH V2 RAW DATASET]'; 3 | 4 | % The name of the scene to demo. 5 | sceneName = '[NAME OF A SCENE YOU WANT TO VIEW]'; 6 | 7 | % The absolute directory of the 8 | sceneDir = sprintf('%s/%s', datasetDir, sceneName); 9 | 10 | % Reads the list of frames. 11 | frameList = get_synched_frames(sceneDir); 12 | 13 | % Displays each pair of synchronized RGB and Depth frames. 14 | for ii = 1 : 15 : numel(frameList) 15 | imgRgb = imread([sceneDir '/' frameList(ii).rawRgbFilename]); 16 | imgDepthRaw = swapbytes(imread([sceneDir '/' frameList(ii).rawDepthFilename])); 17 | 18 | figure(1); 19 | % Show the RGB image. 20 | subplot(1,3,1); 21 | imagesc(imgRgb); 22 | axis off; 23 | axis equal; 24 | title('RGB'); 25 | 26 | % Show the Raw Depth image. 27 | subplot(1,3,2); 28 | imagesc(imgDepthRaw); 29 | axis off; 30 | axis equal; 31 | title('Raw Depth'); 32 | caxis([800 1100]); 33 | 34 | % Show the projected depth image. 35 | imgDepthProj = project_depth_map(imgDepthRaw, imgRgb); 36 | subplot(1,3,3); 37 | imagesc(imgDepthProj); 38 | axis off; 39 | axis equal; 40 | title('Projected Depth'); 41 | 42 | pause(0.01); 43 | end 44 | -------------------------------------------------------------------------------- /scripts/NYU_Depth_Dataset/v2/toolbox/depth_plane2depth_world.m: -------------------------------------------------------------------------------- 1 | % Projects the given depth image to world coordinates. Note that this 3D 2 | % coordinate space is defined by a horizontal plane made from the X and Z 3 | % axes and the Y axis points up. 4 | % 5 | % Args: 6 | % imgDepthAbs - 480x640 depth image whose values indicate depth in 7 | % meters. 8 | % 9 | % Returns: 10 | % points3d - Nx3 matrix of 3D world points (X,Y,Z). 11 | function points3d = depth_plane2depth_world(imgDepthAbs) 12 | [H, W] = size(imgDepthAbs); 13 | assert(H == 480); 14 | assert(W == 640); 15 | 16 | camera_params; 17 | 18 | [xx,yy] = meshgrid(1:W, 1:H); 19 | 20 | X = (xx - cx_d) .* imgDepthAbs / fx_d; 21 | Y = (yy - cy_d) .* imgDepthAbs / fy_d; 22 | Z = imgDepthAbs; 23 | 24 | points3d = [X(:) Y(:) Z(:)]; 25 | end 26 | -------------------------------------------------------------------------------- /scripts/NYU_Depth_Dataset/v2/toolbox/depth_rel2depth_abs.m: -------------------------------------------------------------------------------- 1 | % Projects the given depth image to world coordinates. Note that this 3D 2 | % coordinate space is defined by a horizontal plane made from the X and Z 3 | % axes and the Y axis points up. 4 | % 5 | % Args: 6 | % imgDepthOrig - 480x640 raw depth image from the Kinect. Note that the 7 | % bytes of the original uint16 image must have already 8 | % been swapped via swapbytes.m 9 | % 10 | % Returns: 11 | % imgDepthAbs - 480x640 depth image whose values are in meters, rather 12 | % than the internal depth values used by the kinect. 13 | function imgDepthAbs = depth_rel2depth_abs(imgDepthOrig) 14 | assert(isa(imgDepthOrig, 'double')); 15 | 16 | [H, W] = size(imgDepthOrig); 17 | assert(H == 480); 18 | assert(W == 640); 19 | 20 | camera_params; 21 | 22 | imgDepthAbs = depthParam1 ./ (depthParam2 - imgDepthOrig); 23 | 24 | imgDepthAbs(imgDepthAbs > maxDepth) = maxDepth; 25 | imgDepthAbs(imgDepthAbs < 0) = 0; 26 | end 27 | -------------------------------------------------------------------------------- /scripts/NYU_Depth_Dataset/v2/toolbox/depth_world2rgb_world.m: -------------------------------------------------------------------------------- 1 | % Performs the affine transformation between the Depth-world coordinate 2 | % frame and the RGB-world coordinate frame. 3 | % 4 | % Args: 5 | % points3d - the 3D points in the depth camera's world coordinate frame, 6 | % an Nx3 matrix where N=480*640. 7 | % 8 | % Returns: 9 | % points3d - the 3D points in the RGB camera's world coordinate frame, 10 | % an Nx3 matrix where N=480*640. 11 | function points3d = depth_world2rgb_world(points3d) 12 | camera_params; 13 | 14 | T = [t_x; t_z; t_y]; 15 | points3d = R * points3d' + T * ones(1, size(points3d,1)); 16 | points3d = points3d'; 17 | end -------------------------------------------------------------------------------- /scripts/NYU_Depth_Dataset/v2/toolbox/get_accel_data.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "mex.h" 3 | #include 4 | #include 5 | 6 | int get_data_size(FILE *fp) { 7 | int orig = ftell(fp); 8 | fseek(fp, 0L, SEEK_END); 9 | int out = ftell(fp); 10 | fseek(fp, orig, SEEK_SET); 11 | return out; 12 | } 13 | 14 | void mexFunction(int nlhs, mxArray* plhs[], const int nrhs, const mxArray* prhs[]) { 15 | if (nrhs != 1) { 16 | mexErrMsgTxt("Number of arguments must be exactly 1."); 17 | } else if (!mxIsChar(prhs[0])) { 18 | mexErrMsgTxt("Input must be a string."); 19 | } 20 | 21 | // get the length of the filename. 22 | mwSize filename_length = (mxGetM(prhs[0]) * mxGetN(prhs[0])) + 1; 23 | char *filename = mxArrayToString(prhs[0]); 24 | 25 | FILE* fp = fopen(filename, "r"); 26 | if (fp == NULL) { 27 | mexErrMsgIdAndTxt("filename:notFound", "file %s not found", filename); 28 | } 29 | 30 | int data_size = get_data_size(fp); 31 | if (data_size != sizeof(freenect_raw_tilt_state)) { 32 | mexErrMsgIdAndTxt("filename:notAccel", 33 | "file %s's size doesnt match freenect_raw_tilt_state.", filename); 34 | } 35 | 36 | freenect_raw_tilt_state state; 37 | fread(&state, sizeof(state), 1, fp); 38 | 39 | mwSize ndim = 2; 40 | const mwSize dim_size[] = {4, 1}; 41 | plhs[0] = mxCreateNumericArray(ndim, dim_size, mxDOUBLE_CLASS, mxREAL); 42 | double* output_data = (double*) mxGetData(plhs[0]); 43 | output_data[0] = state.accelerometer_x; 44 | output_data[1] = state.accelerometer_y; 45 | output_data[2] = state.accelerometer_z; 46 | output_data[3] = state.tilt_angle; 47 | 48 | fclose(fp); 49 | } 50 | -------------------------------------------------------------------------------- /scripts/NYU_Depth_Dataset/v2/toolbox/get_accel_data.m: -------------------------------------------------------------------------------- 1 | % Returns the accelerometer data coming from the kinect. 2 | % 3 | % Args: 4 | % filename - the filename of the .dump file. 5 | % 6 | % Returns: 7 | % data - a 4x1 vector where the first three elements are the x, y, and z 8 | % components of the accelerometer and the fourth element is the 9 | % tilt angle. 10 | % 11 | % data = get_accel_data(filename); -------------------------------------------------------------------------------- /scripts/NYU_Depth_Dataset/v2/toolbox/get_instance_masks.m: -------------------------------------------------------------------------------- 1 | % Returns a series of masks for each object instance in the given scene. 2 | % 3 | % Args: 4 | % imgObjectLabels - HxW label map. 0 indicates a missing label. 5 | % imgInstances - HxW instance map. 6 | % 7 | % Returns: 8 | % instanceMasks - binary masks of size HxWxN where N is the number of 9 | % total objects in the room. 10 | % instanceLabels - Nx1 vector of class labels for each instance mask. 11 | function [instanceMasks, instanceLabels] = get_instance_masks(... 12 | imgObjectLabels, imgInstances) 13 | 14 | [H, W] = size(imgObjectLabels); 15 | 16 | pairs = unique([imgObjectLabels(:), uint16(imgInstances(:))], 'rows'); 17 | pairs(sum(pairs, 2) == 0, :) = []; 18 | 19 | N = size(pairs, 1); 20 | 21 | instanceMasks = false(H, W, N); 22 | instanceLabels = zeros(N, 1); 23 | for ii = 1 : N 24 | instanceMasks(:,:,ii) = imgObjectLabels == pairs(ii,1) & imgInstances == pairs(ii,2); 25 | instanceLabels(ii) = pairs(ii,1); 26 | end 27 | end -------------------------------------------------------------------------------- /scripts/NYU_Depth_Dataset/v2/toolbox/get_projection_mask.m: -------------------------------------------------------------------------------- 1 | % Gets a mask for the projected images that is most conservative with 2 | % respect to the regions that maintain the kinect depth signal following 3 | % projection. 4 | % 5 | % Returns: 6 | % mask - HxW binary image where the projection falls. 7 | % sz - the size of the valid region. 8 | function [mask sz] = get_projection_mask() 9 | mask = false(480, 640); 10 | mask(45:471, 41:601) = 1; 11 | 12 | sz = [427 561]; 13 | end -------------------------------------------------------------------------------- /scripts/NYU_Depth_Dataset/v2/toolbox/get_rgb_depth_overlay.m: -------------------------------------------------------------------------------- 1 | % Returns an overlay of RGB and Depth frames to evaluate the alignment. 2 | % 3 | % Args: 4 | % imgRgb - the RGB image, an HxWx3 matrix of type uint8. 5 | % imgDepthAbs - the absolute-depth image, an HxW matrix of type double 6 | % whose values indicate depth in meters. 7 | % 8 | % Returns: 9 | % imgOverlay - an image visualizing RGB and Depth alignment. 10 | function imgOverlay = get_rgb_depth_overlay(imgRgb, imgDepthAbs) 11 | % Check dims. 12 | assert(ndims(imgRgb) == 3); 13 | assert(ndims(imgDepthAbs) == 2); 14 | 15 | % Check sizes. 16 | [H, W, D] = size(imgRgb); 17 | assert(D == 3); 18 | assert(all(size(imgDepthAbs) == [H, W])); 19 | 20 | % Check types. 21 | assert(isa(imgRgb, 'uint8')); 22 | assert(isa(imgDepthAbs, 'double')); 23 | 24 | imgDepth = imgDepthAbs - min(imgDepthAbs(:)); 25 | imgDepth = imgDepth ./ max(imgDepth(:)); 26 | imgDepth = uint8(imgDepth * 255); 27 | 28 | imgOverlay = reshape(imgRgb, [H*W 3]); 29 | imgOverlay(:,3) = imgOverlay(:,2); 30 | imgOverlay(:,2) = imgDepth(:); 31 | 32 | imgOverlay = reshape(imgOverlay, [H, W, 3]); 33 | end -------------------------------------------------------------------------------- /scripts/NYU_Depth_Dataset/v2/toolbox/get_scene_type_from_scene.m: -------------------------------------------------------------------------------- 1 | % Returns the scene type (living room, starbucks, subway, etc) from the 2 | % scene (living_room_0002k, office_0013, etc). 3 | % 4 | % Args: 5 | % scene - the scene name: [sceneType]_[sceneNumber] 6 | % 7 | % Returns: 8 | % sceneType - the name of the scene type. 9 | function sceneType = get_scene_type_from_scene(scene) 10 | ind = regexp(scene, '\d+\w?'); 11 | sceneType = scene(1:ind-2); 12 | end -------------------------------------------------------------------------------- /scripts/NYU_Depth_Dataset/v2/toolbox/get_timestamp_from_filename.m: -------------------------------------------------------------------------------- 1 | % Extracts the timestamp from the filename. 2 | % 3 | % Example usage: 4 | % filename = [CLIPS_DIR '/r-1339729868.166858-2965701968.ppm'] 5 | % matlabTime = get_timestamp_from_filename(filename); 6 | % disp(datestr(matlabTime, 'mm/dd/yy HH:MM:SS.FFF')); 7 | % 8 | % 9 | % 10 | % Args: 11 | % filename - the path to the raw kinect output file. 12 | % 13 | % Returns: 14 | % matlabTime - the matlab time which can be passed to datestr 15 | function matlabTime = get_timestamp_from_filename(filename) 16 | parts = regexp(filename(3:end), '-', 'split'); 17 | millis = str2double(parts{2}); 18 | 19 | % Time since the epoch, correcting for offset between UTC and EST 20 | % (technically a good chunk of the film was shot in CST, but se la vi). 21 | unixEpoch = datenum(1969,12,31,20,0,0); 22 | matlabTime = millis ./ 86400 + unixEpoch; 23 | end -------------------------------------------------------------------------------- /scripts/NYU_Depth_Dataset/v2/toolbox/maplabels.m: -------------------------------------------------------------------------------- 1 | function mapped = maplabels(origlbl, mapping) 2 | 3 | mapped = origlbl; 4 | 5 | for i=1:length(mapping) 6 | idx = (origlbl == i); 7 | mapped(idx) = mapping(i)-1; 8 | end 9 | -------------------------------------------------------------------------------- /scripts/NYU_Depth_Dataset/v2/toolbox/rgb_plane2rgb_world.m: -------------------------------------------------------------------------------- 1 | function points3d = rgb_plane2rgb_world(imgDepth) 2 | camera_params; 3 | [H, W] = size(imgDepth); 4 | 5 | % Make the original consistent with the camera location: 6 | [xx, yy] = meshgrid(1:W, 1:H); 7 | 8 | x3 = (xx - cx_rgb) .* imgDepth / fx_rgb; 9 | y3 = (yy - cy_rgb) .* imgDepth / fy_rgb; 10 | z3 = imgDepth; 11 | 12 | points3d = [x3(:) y3(:) z3(:)]; 13 | end 14 | -------------------------------------------------------------------------------- /scripts/NYU_Depth_Dataset/v2/toolbox/rgb_world2rgb_plane.m: -------------------------------------------------------------------------------- 1 | % Performs the camera projection from the RGB-world coordinate frame onto 2 | % the RGB plane. 3 | % 4 | % Args: 5 | % points3d - Nx3 matrix of (X,Y,Z) points in the RGB-world coordinate 6 | % frame. 7 | % 8 | % Returns: 9 | % X_plane - the X coordinates in the RGB plane. 10 | % Y_plane - the Y coordiantes in the RGB plane. 11 | function [X_plane, Y_plane] = rgb_world2rgb_plane(points3d) 12 | camera_params; 13 | 14 | X_world = points3d(:,1); 15 | Y_world = points3d(:,2); 16 | Z_world = points3d(:,3); 17 | 18 | X_plane = (X_world .* fx_rgb ./ Z_world) + cx_rgb; 19 | Y_plane = (Y_world .* fy_rgb ./ Z_world) + cy_rgb; 20 | end -------------------------------------------------------------------------------- /scripts/NYU_Depth_Dataset/v2/uwrite/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strands-project/v4r/7cb817e05cb9d99cb2f68db009c27d7144d07f09/scripts/NYU_Depth_Dataset/v2/uwrite/.DS_Store -------------------------------------------------------------------------------- /scripts/NYU_Depth_Dataset/v2/uwrite/README: -------------------------------------------------------------------------------- 1 | UREAD/UWRITE are like FREAD/FWRITE except that they operate on arrays 2 | in memory. 3 | 4 | A=UWRITE(D, PREC) will create a uint8 array A from the double array D. 5 | The format of the binary data in A is determined by PREC (one of 6 | uint8, uint16, uint32, int8 int16, int32, float32, float64, or 7 | double). The size of A is dependent on the precision PREC. 8 | 9 | D=UREAD(A, N, PREC) will read the uint8 array A and return N values 10 | into D. The data in A are assumed to be in the format of PREC (see 11 | UWRITE for supported formats). 12 | 13 | Installation: 14 | 15 | 1. Install the files, creating directory ``uwrite'': 16 | gunzip -c uwrite.tar.gz | tar -xvf - 17 | 18 | 2. Add the directory to your matlab path: 19 | path(path, '/uwrite'); 20 | 21 | 3. Set up the MEX compiler following the instructions supplied by 22 | Mathworks: 23 | mex -setup 24 | 25 | 4. Compile the C files: 26 | cd /uwrite 27 | mex uread.c 28 | mex uwrite.c 29 | 30 | Usage: 31 | 32 | 1. Add the directory to your matlab path: 33 | path(path, '/uwrite'); 34 | 35 | 2. ``help uread'' and ``help uwrite'' will give instructions. Also 36 | look at the source code in uread.c and uwrite.c 37 | 38 | If you find a bug please let me know. 39 | 40 | Thanks, 41 | Sridhar Anandakrishnan 42 | sak@essc.psu.edu 43 | 44 | 45 | -------------------------------------------------------------------------------- /scripts/NYU_Depth_Dataset/v2/uwrite/uwrite.m: -------------------------------------------------------------------------------- 1 | %UWRITE Write binary data to char vector. 2 | % S = UWRITE(A,PRECISION) writes the elements of matrix A 3 | % to a char column vector S, translating MATLAB values to the specified 4 | % precision. The data are written in column order. 5 | % 6 | % PRECISION controls the form and size of the result. See the list 7 | % of allowed precisions under UREAD. 'bitN' and 'ubitN' are not supported. 8 | % 9 | % For example, 10 | % 11 | % s=uwrite(magic(5),'int32') 12 | % 13 | % creates a 100-byte uint8 column vector S, containing the 25 elements of the 14 | % 5-by-5 magic square, stored as 4-byte integers. 15 | % 16 | % See also UREAD, FWRITE, FREAD, FPRINTF, SAVE, DIARY. 17 | % 18 | % Copyright (c) 2002 Sridhar Anandakrishnan, sak@essc.psu.edu 19 | -------------------------------------------------------------------------------- /scripts/get_3dNet_Cat10.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | cd data 4 | echo "Downloading Cat10 model database from 3dNet..." 5 | output=$(wget -c https://repo.acin.tuwien.ac.at/tmp/permanent/3d-net.org/Cat10_ModelDatabase.zip) 6 | if [ $? -ne 0 ]; then 7 | echo "Error downloading file" 8 | else 9 | echo "File has been downloaded" 10 | echo "Unzipping..." 11 | mkdir 3dNet 12 | cd 3dNet 13 | 14 | if ! unzip ../Cat10_ModelDatabase.zip &> /dev/null; then 15 | echo "Failure during unzipping.." 16 | else 17 | echo "Successfully unzipped file! Cleaning up..." 18 | 19 | #remove broken .ply-files (they produce segmentation fault during rendering - do not know why) 20 | rm Cat10_ModelDatabase/hammer/6683cadf1d45d69a3a3cbcf1ae739c36.ply 21 | rm Cat10_ModelDatabase/mug/a35a92dcc481a994e45e693d882ad8f.ply 22 | rm Cat10_ModelDatabase/mug/b88bcf33f25c6cb15b4f129f868dedb.ply 23 | rm Cat10_ModelDatabase/tetra_pak/a28d27ec2288b962f22e103132f5d39e.ply 24 | rm Cat10_ModelDatabase/toilet_paper/da6e2afe4689d66170acfa4e32a0a86.ply 25 | 26 | cd .. 27 | rm Cat10_ModelDatabase.zip 28 | echo "Done!" 29 | fi 30 | fi 31 | 32 | cd .. 33 | 34 | -------------------------------------------------------------------------------- /scripts/get_3dNet_test_data.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | cd data 4 | echo "Downloading test database from 3dNet..." 5 | output=$(wget -c https://repo.acin.tuwien.ac.at/tmp/permanent/3d-net.org/Cat10_TestDatabase.zip) 6 | if [ $? -ne 0 ]; then 7 | echo "Error downloading file" 8 | else 9 | echo "File has been downloaded" 10 | echo "Unzipping..." 11 | mkdir -p 3dNet/Cat10_TestDatabase 12 | cd 3dNet/Cat10_TestDatabase 13 | 14 | if ! unzip ../../Cat10_TestDatabase.zip &> /dev/null; then 15 | echo "Failure during unzipping.." 16 | else 17 | echo "Successfully unzipped file! Cleaning up..." 18 | 19 | #remove broken files 20 | cd pcd_binary 21 | mv tt_hmrr107.pcd tt_hmrr107.pcd_broken 22 | mv tt_hmrr116.pcd tt_hmrr116.pcd_broken 23 | mv tt_hmrr132.pcd tt_hmrr132.pcd_broken 24 | mv tt_hmrr141.pcd tt_hmrr141.pcd_broken 25 | cd .. 26 | 27 | cd ../.. 28 | rm Cat10_TestDatabase.zip 29 | echo "Done!" 30 | fi 31 | fi 32 | 33 | cd .. 34 | 35 | -------------------------------------------------------------------------------- /scripts/get_caffe_network.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | mkdir cfg 4 | cd cfg 5 | 6 | echo "Downloading network definition" 7 | wget -c https://raw.githubusercontent.com/BVLC/caffe/master/models/bvlc_reference_caffenet/deploy.prototxt 8 | echo "Downloading trained network parameters" 9 | wget -c http://dl.caffe.berkeleyvision.org/bvlc_reference_caffenet.caffemodel #trained network 10 | echo "Downloading trained mean pixel values" 11 | wget -c http://dl.caffe.berkeleyvision.org/caffe_ilsvrc12.tar.gz 12 | 13 | echo "Unzipping..." 14 | tar -xf caffe_ilsvrc12.tar.gz && rm -f caffe_ilsvrc12.tar.gz train.txt test.txt val.txt *synset* imagenet.bet.pickle 15 | cd .. 16 | 17 | echo "Done!" 18 | -------------------------------------------------------------------------------- /setup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ $# -eq 0 ] 4 | then 5 | # No arguments supplied 6 | ubuntu_version_name="trusty" 7 | ros_version="indigo" 8 | 9 | elif [ $# -eq 2 ] 10 | then 11 | ubuntu_version_name=${1} 12 | ros_version=${2} 13 | 14 | else 15 | echo "ERROR: Wrong usage" 16 | echo "Usage: $0 ubuntu_code_name ros_code_name eg. $0 xenial kinetic" 17 | exit 1 18 | 19 | fi 20 | 21 | echo "Installing Dependencies for V4R (Ubuntu ${ubuntu_version_name} using ROS ${ros_version})..." 22 | echo "If you want to change this you can pass in the codename of the Ubuntu release. Eg. $0 xenial kinetic for 16.04 with ROS kinetic" 23 | 24 | if [ ! -f /etc/apt/sources.list.d/ros-latest.list ]; then 25 | sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu '${ubuntu_version_name}' main" > /etc/apt/sources.list.d/ros-latest.list' 26 | fi 27 | 28 | wget http://packages.ros.org/ros.key -O - | sudo apt-key add - 29 | sudo apt-get update -qq > /dev/null 30 | sudo apt-get install -qq -y python-rosdep build-essential cmake > /dev/null 31 | sudo rosdep init > /dev/null 32 | 33 | rosdep update > /dev/null 34 | rosdep install -q --from-paths . -i -y -r --rosdistro ${ros_version} > /dev/null 35 | --------------------------------------------------------------------------------