ySalaun / LineSfM

131 stars 46 forks source link

openMVG .feat question #1

Open ctwpotter opened 6 years ago

ctwpotter commented 6 years ago

Dear @ySalaun , thanks for provide this LineSfM code. Lately I test this code. I found I got the different results compared to the result presented in your paper 《Robust SfM with Little Image Overlap》. I tested the sample images following the steps of the instruction: LSD_MULTISACALE--VANISHING_POINT--LINE_MATCHING--CALIBRATION--RECONSTRUCTION, but the dence.refined.mesh.ply only contains four 3D points.

ply format ascii 1.0 element vertex 4 property float x property float y property float z property uchar red property uchar green property uchar blue element face 0 property list uint8 int32 vertex_indices end_header 0.0106194 -0.189911 0.14482 50 255 50 0.803659 -0.126331 0.723105 50 255 50 1.567 -0.0715306 1.42358 50 255 50 2.56536 -0.0378929 1.85199 50 255 50

I notice that the openMVG folder is where I should save my detection with my openMVG, so I wonder if I got the wrong detection of the openMVG.

ySalaun commented 6 years ago

Hi @ctwpotter I am not sure to understand exactly what you did, so I have some questions for you

I'm sorry but I haven't used this code for almost a year and I won't be able to test it on my computer but I'll try my best to help you,

Yohann

ctwpotter commented 6 years ago

Dear @ySalaun . Thanks for your quick reply. Here are the answers to your questions. q1: I changed the path of images of my own images path inside images.txt file. q2: Yes, I use openMVG to detect points independantly of this code, I get the .feat file and matches.putative.txt generated by the openMVG. q3: I check the detected lines, matched lines, vanishing points in the folder pictures, it seems that they are correct. q4: When I use TEST_IMAGES folder, the rotation and translation error are ok. But when I test my own pictures, the error summary turns to: Error in rotation : 120 Error in translation : nan And I do not which part went wrong. q5: I test this code on ubuntu 16.04. Thanks again for your reply and help, I hope I could use the LineSFM to obtain a 3D model in the indoor scenes. ctwpotter

ySalaun commented 6 years ago

Just to be sure:

There might be many reasons:

Just to be sure, the code should work fine with ordered pictures (consecutive ones as in the sample). If it is not the case, it might not works well. Could you also send me some samples of your pictures with line matches (best would be with consecutive pictures so I can have a look at the overlap)

Best,

Yohann

ctwpotter commented 6 years ago

Sorry for reply your message so late. The code doesn't work well with the TEST_IMAGES, the dense.mesh.ply only contains four 3D points. That's why I wonder if I got the wrong files generated by the openMVG, cause they are the files generated by myself. I also tested the data sets taken by myself with ordered pictures. Still can't get a nice work. ctwpotter

ySalaun commented 6 years ago

I think I know the issue: I compute a bounding box of the scene for the final mesh display. This bounding box is computed using the camera position and a rough erosion is used to avoid displaying outliers. For a whole scene it usually works correctly but for one triplet only it won't work.

The best thing to test it would be to run the code on the whole Strecha dataset: https://github.com/openMVG/SfM_quality_evaluation/tree/master/Benchmarking_Camera_Calibration_2008

About your picture it can either be an issue during calibration (as I've explained in my previous post) or a similar error of bounding box or still another issue. Best would be to obtain good results with Strecha first.

Best,

Yohann

ySalaun commented 6 years ago

In saveMesh function inside interface.cpp you can change the code to modify the bounding box computation. It is also possible to disable the use of this bounding box by using false as insideMode argument (last argument, default is false) for saveMesh function inside main_reconstruction.cpp

Yohann