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

How can I execute the following statement about colmap correctly? #19

Closed
ZhenyuSun-Walker opened this issue Jul 31, 2024 · 8 comments
Closed

Comments

@ZhenyuSun-Walker
Copy link

Hello, I wonder what should I do in order to execute python lib/colmap/imgs2poses.py -s examples/scene1 correctly?
Actually I have used several other commads of colmap to replace the command above, in order to avoid the error of no gui interfaces.

@TQTQliu
Copy link
Owner

TQTQliu commented Jul 31, 2024

Please refer to here, this might help you.

@ZhenyuSun-Walker
Copy link
Author

Sorry,I didn't mean that. My problem is that when I directly run ·python lib/colmap/imgs2poses.py -s examples/scene1·,It will show that ·python lib/colmap/imgs2poses.py -s dataset/MVDiffusion_demo16
Need to run COLMAP
qt.qpa.xcb: could not connect to display
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, xcb.

*** Aborted at 1722417347 (unix time) try "date -d @1722417347" if you are using GNU date ***
PC: @ 0x7fc23dfc500b gsignal
*** SIGABRT (@0x3ef0015844b) received by PID 1410123 (TID 0x7fc2397bf900) from PID 1410123; stack trace: ***
@ 0x7fc23fbb3631 (unknown)
@ 0x7fc23f0f6420 (unknown)
@ 0x7fc23dfc500b gsignal
@ 0x7fc23dfa4859 abort
@ 0x7fc23e589aad QMessageLogger::fatal()
@ 0x7fc23eb6b7ae QGuiApplicationPrivate::createPlatformIntegration()
@ 0x7fc23eb6c708 QGuiApplicationPrivate::createEventDispatcher()
@ 0x7fc23e790f55 QCoreApplicationPrivate::init()
@ 0x7fc23eb6e543 QGuiApplicationPrivate::init()
@ 0x7fc23f2783bd QApplicationPrivate::init()
@ 0x55ef836f7602 RunFeatureExtractor()
@ 0x55ef836e3eaf main
@ 0x7fc23dfa6083 __libc_start_main
@ 0x55ef836e7f6e _start
Traceback (most recent call last):
File "lib/colmap/imgs2poses.py", line 18, in
gen_poses(args.scenedir, args.match_type)
File "/home/sunzhenyu/Projects/MVSGaussian/lib/colmap/poses/pose_utils.py", line 268, in gen_poses
run_colmap(basedir, match_type)
File "/home/sunzhenyu/Projects/MVSGaussian/lib/colmap/poses/colmap_wrapper.py", line 35, in run_colmap
feat_output = ( subprocess.check_output(feature_extractor_args, universal_newlines=True) )
File "/home/sunzhenyu/anaconda3/envs/mvsgs/lib/python3.7/subprocess.py", line 411, in check_output
**kwargs).stdout
File "/home/sunzhenyu/anaconda3/envs/mvsgs/lib/python3.7/subprocess.py", line 512, in run
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['colmap', 'feature_extractor', '--database_path', 'dataset/MVDiffusion_demo16/database.db', '--image_path', 'dataset/MVDiffusion_demo16/images', '--ImageReader.single_camera', '1']' died with <Signals.SIGABRT: 6>.·

How can I solve the problem?

@TQTQliu
Copy link
Owner

TQTQliu commented Jul 31, 2024

The problem here is the same as yours.
qt.qpa.xcb: could not connect to display qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found. This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem. Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, xcb.
RyanPham19092002 solved the problem, but I don't know if he or she took the advice I offered.

@ZhenyuSun-Walker
Copy link
Author

Thank you for your suggestions!However,it does not work for me. Would you mind telling me why you can normally run the command python lib/colmap/imgs2poses.py -s examples/scene1?

@TQTQliu
Copy link
Owner

TQTQliu commented Jul 31, 2024

Another option is to run colmap first for sparse reconstruction, please refer to https://colmap.github.io/cli.html#.
After it, you can get the sparse folder, which includes 0/cameras.bin, 0/images.bin, 0/points3D.bin, and then place the above sparse folder in the examples/scene1 directory and run the same command:

python lib/colmap/imgs2poses.py -s examples/scene1

In this case, the imgs2poses.py script recognizes that sparse reconstruction results already exist, automatically skips the colmap reconstruction phase, and simply organizes the existing results to produce the required poses_bounds.npy.

See here for details.

@ZhenyuSun-Walker
Copy link
Author

Actually, that is what I have done to avoid the contradictory. However,when I run colmap mapper --database_path examples/scene1/database.db --image_path examples/scene1/images --output_path examples/scene1/sparse to generate 0/cameras.bin, 0/images.bin, 0/points3D.bin, and then place the above sparse folder in the my own dataset folders, it always finishes with `Bundle adjustment report

Residuals : 1028

Parameters : 778
Iterations : 101
Time : 9.00131 [s]
Initial cost : 0.388099 [px]
Final cost : 0.377106 [px]
Termination : No convergence

=> Filtered observations: 0
=> Filtered images: 0
=> No good initial image pair found.

Elapsed time: 0.594 [minutes]`

Although it is effective when coping with your dataset in the examples.

@TQTQliu
Copy link
Owner

TQTQliu commented Jul 31, 2024

The error may be due to low overlap of images, a similar error can be found here and here.

@ZhenyuSun-Walker
Copy link
Author

Actually, once my dataset can be suitable for the colmap operation step by step in the terminal. But now, it does not
work, and I really have no idea about why it happens.

@TQTQliu TQTQliu closed this as completed Aug 2, 2024
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