point-cloud-library

PCL: Scale two Point-Clouds to the same size

落爺英雄遲暮 提交于 2020-01-13 19:45:26
问题 I got two point clouds and try to scale them to the same size. My first approach was to just divide the square roots from the eigenvalues: pcl::PCA<pcl::PointNormal> pca; pca.setInputCloud(model_cloud_ptr); Eigen::Vector3f ev_M = pca.getEigenValues(); pca.setInputCloud(segmented_cloud_ptr); Eigen::Vector3f ev_S = pca.getEigenValues(); double s = sqrt(ev_M[0])/sqrt(ev_S[0]); This helps me to scale my model cloud to have approximately the same size as my segmented cloud. But the result is

How to Display a 3D image when we have Depth and rgb Mat's in OpenCV (captured from Kinect)

北慕城南 提交于 2020-01-10 02:09:11
问题 We captured a 3d Image using Kinect with OpenNI Library and got the rgb and depth images in the form of OpenCV Mat using this code. main() { OpenNI::initialize(); puts( "Kinect initialization..." ); Device device; if ( device.open( openni::ANY_DEVICE ) != 0 ) { puts( "Kinect not found !" ); return -1; } puts( "Kinect opened" ); VideoStream depth, color; color.create( device, SENSOR_COLOR ); color.start(); puts( "Camera ok" ); depth.create( device, SENSOR_DEPTH ); depth.start(); puts( "Depth

icp transformation matrix interpretation

霸气de小男生 提交于 2020-01-04 04:15:09
问题 I'm using PCL to obtain the transformation matrix from ICP (getTransformationMatrix()). The result obtained for exemple for a translation movement without rotation is 0.999998 0.000361048 0.00223594 -0.00763852 -0.000360518 1 -0.000299474 -0.000319525 -0.00223602 0.000298626 0.999998 -0.00305045 0 0 0 1 how can I find the trasformation from the matrix? The idea is to see the error made between the stimation and the real movement 回答1: I have not used the library you refer to here, but it is

Remove points outside defined 3D box inside PCL visualizer

五迷三道 提交于 2020-01-03 17:06:29
问题 In a given point cloud, I want to remove all the points which are less than min and greater than max for all x , y and z direction. Below is the sample code: #include <pcl/io/io.h> #include <pcl/io/pcd_io.h> #include <pcl/filters/passthrough.h> #include <pcl/visualization/pcl_visualizer.h> // Define min and max for X, Y and Z float minX = -0.1, minY = -0.5, minZ = -2.5; float maxX = +0.1, maxY = +0.5, maxZ = +2.5; int main (int argc, char** argv) { pcl::visualization::PCLVisualizer viewer(

Visualize pointcloud

隐身守侯 提交于 2020-01-03 08:55:22
问题 I have 3D points from gpu::reprojectImageTo3D on a found disparity image. I would now like to display this pointcloud. How do I Convert the found pointcloud from OpenCV to sensor_msgs/PointCloud2 ? I do not need to publish the pointcloud this is only for debug visualization. Could it be possible to display it as is done with images from the node? e.g. using pcl ? This would be optimal since my device may not perform well with RViz (based on readings online). 回答1: My best guess is to do like

How to visualize a sequence of TOF-Sensor data in PCL (with Qt)?

狂风中的少年 提交于 2020-01-02 19:29:27
问题 I've this TOF-sensor and I want to visualize the sensor's data as a point-cloud in Qt. I converted the data into a pcl::PointCloud and now I want to visualize it. The API of the sensor would emit a picture whenever one was created. And I would send it to the QVTKWidget to visualize it. And I tried it with this snippet of code (which I got from here): pcl::visualization::PCLVisualizer pvis ("test_vis", false); // 'false' prevents PCLVisualizer's own window to pop up pvis.addPointCloud<pcl:

Difference between visualizing a mesh and its point cloud

旧城冷巷雨未停 提交于 2020-01-02 06:42:07
问题 I'm working with PCL and a Mesh editor (MeshLab). I'm interested in importing my meshes to PCL to do some 3D processing. I've a mesh model in ply format. When I load the model with the code: PointCloud<PointXYZRGBA>::Ptr cloud (new PointCloud<PointXYZRGBA> ()); pcl::io::loadPLYFile<pcl::PointXYZRGBA>(argv[1], *cloud); and I visualize it as a point cloud: visualization::PCLVisualizer viewer ("Model"); viewer.addPointCloud (cloud,"model"); the geometry is different from loading and visualizing

using “pcl::visualization” in different threads from different instance of a class

六眼飞鱼酱① 提交于 2019-12-30 10:33:19
问题 I want to have a class which contain a visualizer on a cloud point. here is my code: class my_vis { void vis_func () { pcl::visualization::PCLVisualizer *vis ; vis = new pcl::visualization::PCLVisualizer("octree viewer"); // this "vis" is just used in this function and no other place } void execute(){ //Start visualizer in a thread boost::thread* visThread = new boost::thread(boost::bind(&my_vis::vis_func, this)); // bla bla } } int main () { my_vis vis1(); vis1.execute(); my_vis vis2(); vis2

PCL create a pcd cloud

♀尐吖头ヾ 提交于 2019-12-30 05:30:08
问题 This is what I have so far and I want to save pcd file from it I know I have to do something like this but not exactly sure pcl::PointCloud::PointPointXYZRGBA> cloud; pcl::io:;savePCDFileASCII("test.pcd",cloud); what do i have to add in my current code that i will have test.pcd Thanks #include <pcl/point_cloud.h> #include <pcl/point_types.h> #include <pcl/io/openni_grabber.h> #include <pcl/visualization/cloud_viewer.h> #include <pcl/common/time.h> class SimpleOpenNIProcessor { public:

RANSAC-like implementation for arbitrary 2D sets

一曲冷凌霜 提交于 2019-12-29 06:53:05
问题 TL;DR : Is there a C++ implementation of RANSAC or other robust correspondence algorithms that is freely usable with arbitrary 2D point sets? I know that many implementations exist that include or make use of correspondence algorithms such as RANSAC (Random Sampling Consensus). They are often used in computer vision applications and found in libraries such as OpenCV, PCL, etc. The general algorithm is well known and various site lists the different steps. Now, all the "advanced"