nmellado / Super4PCS

Efficient Global Point-cloud registration
http://nmellado.github.io/Super4PCS/
Other
454 stars 215 forks source link

Set to Subset matching? #31

Closed antithing closed 3 years ago

antithing commented 7 years ago

Hi, and thank you for making this code available! I have a large pointcloud ( a room scan) and a smaller one (a section of the same room, sharing some, but not all points). I have these matching, using your code, but I am trying to run this as fast as I possibly can, for real time use. Using these settings:

-o 0.8 -d 0.02 -t 1000 -n 50

I have this down to 43 ms. Is it possible to get this even faster, whilst keeping accuracy?

Also, i see a worse result when I add outliers. This is expected, I guess, but is are there settings, or something I can look at to improve outlier rejection?

My clouds are sparse, the larger is generally around 6000 points, and the smaller, around 900..

Thank you once again!

nmellado commented 7 years ago

Hi @antithing,

I have this down to 43 ms. Is it possible to get this even faster, whilst keeping accuracy?

Super4PCS has been made to be fast, but it wasn't tailored for real time use :). So, we have two options:

Also, i see a worse result when I add outliers. This is expected, I guess, but is are there settings, or something I can look at to improve outlier rejection?

It is very likely that the very small number of samples (-n 50) cause this sensitivity to outliers.

I can have a look at your data to give more specific advices, and adapt the code if required.

Cheers

antithing commented 7 years ago

Hi! thank you for getting back to me. I was testing with dummy data to get the results above, now that i am using examples of my actual data, i get a terrible result! If you have a moment to look over my points and tell me what is wrong, it would be much appreciated! Please see the attached csv files. I use this function to load them:

vector<Point3D> loadCSVFile(const std::string &in_filename)
{   
    using namespace std;
    vector<Point3D> cloud;
    //open file
    ifstream in(in_filename.c_str());
    if (!in.is_open())  {
        std::cout << "Error loading file\n" << std::endl;
    }   
    vector <vector <string> > points;
    ifstream infile(in_filename.c_str());

    while (infile)
    {
        string s;
        if (!getline(infile, s)) break;

        istringstream ss(s);
        vector <string> coords;

        while (ss)
        {
            string s;
            if (!getline(ss, s, ' ')) break;
            coords.push_back(s);

        }
        //Create the point
        Point3D point;
        point.x = atof(coords[0].c_str());
        point.y = atof(coords[1].c_str());
        point.z = atof(coords[2].c_str());
        cloud.push_back(point);
    }
    if (!infile.eof())
    {
        cerr << "file loaded as points.\n";
    }   
    return cloud;
}

Thank you again! :)

5.zip

nmellado commented 7 years ago

Hi,

Here is what I got when I load your data with meshlab (after renaming the files from .csv to .xyz).

Does it look good ? I don't understand the shape described by the cloud: snapshot00

antithing commented 7 years ago

Hi, thank you again for taking the time to help me out! that does look right, it is a partial scan of a room, created using stereo ORBSLAM. The attached image shows both this cloud(which is the global map) and the smaller map (which is the points visible in a single frame of the stereo vision)

The green points are the global, the red, the frame points. The white boxes show points that are created from two checkerboards, so should be able to be easily matched).

Thanks again!

matched

nmellado commented 7 years ago

Hi @antithing ,

Your cloud have very low density, which cause ambiguities with the LCP metric. Can you use clouds with more samples ?

One option could be to change from the LCP to point-to-point metric, but this would require some development effort.

Cheers,