Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Core dump: Assertion `p.first != p.second' failed. #46

Open
mardy opened this issue Feb 9, 2017 · 11 comments
Open

Core dump: Assertion `p.first != p.second' failed. #46

mardy opened this issue Feb 9, 2017 · 11 comments

Comments

@mardy
Copy link
Contributor

mardy commented Feb 9, 2017

I'm running bundler on a set of photos with no focal length information. I first ran into a problem because the image resolution was too high (5312x3984 pixels) for sift to handle, so I downscaled them all to half their size. Incidentally, if someone has a link to the sift source code, please share it: I want to rebuild it with this limitation lifted, and also make a 64bit version of it.

Anyway, according to FAQ item 1, I first ran the bundler.py script with the --extract-focal parameter to obtain the list.txt file, and there I extended each line with " 0 3187". This is probably not the real focal length, just a quick estimate (I've read that a reasonable estimation for the focal length is max(width, height) * 1.2). Then I ran the bundler.py script again (with no options), so that it could compute the matches, and then I ran bundler list.txt --options_file options.txt and got this:

[OnInit] Running program bundler
Loading images from file 'list.txt'
[BundlerApp::OnInit] Processing options...
[BundlerApp::OnInit] Loading frame...
[BundlerApp::OnInit] Loading images...
[ReadGeometricConstraints] Reading 0 tracks
[ReadGeometricConstraints] Reading tracks took 0.000s
[ReadTrackPairs] Read 0 track pairs
  Avg. proj error [0 projections] = -nan
[BundleAdjust] Error: no good camera pairs found!
[BundleAdjust] Trying a backup approach...
[BundleAdjust] Error: no good camera pairs found!
[BundleAdjust] Picking first two cameras...
[BundleAdjust] Adjusting cameras 0 and 1 (score = 0.000)
[GetJPEGDimensions] File ./image20170205_134820745.jpg: ( 2656 , 1992 )
[GetJPEGDimensions] File ./image20170205_134551277.jpg: ( 2656 , 1992 )
[BaseApp::SetTracks] Setting tracks for image 0...
[BaseApp::SetTracks] Finished in 0.000s
[BaseApp::SetTracks] Setting tracks for image 1...
[BaseApp::SetTracks] Finished in 0.000s
bundler: BaseApp.h:271: std::vector<KeypointMatch>& MatchTable::GetMatchList(MatchIndex): Assertion `p.first != p.second' failed.
Aborted (core dumped)

Could it be because my focal length estimation was way off, or is there some other problem here?
Also, when downscaling the photos, should the focal length be downscaled proportionally, or should itbe left untouched?

@snavely
Copy link
Owner

snavely commented Feb 9, 2017 via email

@mardy
Copy link
Contributor Author

mardy commented Feb 12, 2017

Hi Noah, thanks for your reply! So, I rebuilt bundler with siftfast, and adjusted the scripts to use it instead of sift. Now the feature detection works without the need of downscaling the images.

However, I still get the same error when running Bundler. I've ran it from a clean directory (with only the images in), and no matches subdirectory was created (but maybe that's the way the bundler.py script works?); instead, there are these files:

list.txt
matches.corresp.txt
matches.init.txt
matches.prune.txt
matches.ransac.txt
nmatches.corresp.txt
nmatches.prune.txt
nmatches.ransac.txt
options.txt
pairwise_scores.txt

They have data inside, but the matches.corresp.txt is a bit suspicious in that it contains just 1062 empty lines -- no other content at all.
I'm attaching the bundle/out file, which is much bigger than the previous one: bundle.txt

Please let me know if you'd like to have a look at any of the files above, I'll attach them here.

@snavely
Copy link
Owner

snavely commented Feb 13, 2017 via email

@mardy
Copy link
Contributor Author

mardy commented Feb 13, 2017

I'm using these images:
https://github.com/rperrot/ReconstructionDataSet/tree/master/MirebeauStHilaireStatue

I want to make a comparison among SfM software, so I'm trying the same dataset with bundler, mve, colmap, VisualSfM, openMVG, etc. This dataset seems to work fine with the other programs, so it's probably a matter of giving bundler the right options. Any hints will be very appreciated :-)

@snavely
Copy link
Owner

snavely commented Feb 13, 2017 via email

@snavely
Copy link
Owner

snavely commented Feb 14, 2017 via email

@mardy
Copy link
Contributor Author

mardy commented Feb 14, 2017

Did you use sift or siftfast? I've yet to verify how things work if I try to swap x and y in siftfast. Maybe that's the issue. I'll try tonight, and let you know.

@snavely
Copy link
Owner

snavely commented Feb 14, 2017 via email

@mardy
Copy link
Contributor Author

mardy commented Feb 14, 2017 via email

@mardy
Copy link
Contributor Author

mardy commented Feb 15, 2017

About my reconstruction: I do get a noticeably better result if I modify the siftfast tool to swap columns with rows in its output, so your suggestion was probably right.

@mardy
Copy link
Contributor Author

mardy commented Feb 16, 2017

After verifying the images alignment with the point cloud with MeshLab, I have to walk back my last remark: siftfast is not swapping x with y.

bundler is doing a fair job at reconstructing the scene (I get a point cloud of about 12000 points), but it seems that a few images are not being used for reconstruction, causing poor details on the most interesting parts.

Here's the bundle log

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants