colmap icon indicating copy to clipboard operation
colmap copied to clipboard

Point triangulator error: Check failed: existing_image.Name() == image.second.Name()

Open KhaledSharif opened this issue 5 years ago • 3 comments

Describe the bug Check fails when attempting point triangulation. I am attempting to reconstruct a sparse/dense model from known camera poses as outlined here.

To Reproduce

I produced an images.txt file with only one camera (camera ID = 1 for all images). The head of the file is shown below.

root@jetson:/media/jetson/known_poses# head images.txt
1 -0.4080619246677543 -0.6198294349978429 0.3076475753717585 0.5955248999954418 1029.2328376522535 2030.3300587656101 2997.191450284511 1 1_1_0_0_0_60_-30.png

2 -0.29845073348239864 -0.6638352739580076 0.1953414655698169 0.6573367482211467 1029.2328376522535 2030.3300587656101 2997.191450284511 1 1_1_0_0_0_60_-50.png

3 -0.17977126778353844 -0.6876708140358151 0.07710000418408751 0.6991757519805962 1029.2328376522535 2030.3300587656101 2997.191450284511 1 1_1_0_0_0_60_-70.png

4 -0.055629543081726185 -0.6906118244073665 -0.04348410181429079 0.7197706543161171 1029.2328376522535 2030.3300587656101 2997.191450284511 1 1_1_0_0_0_60_-90.png

5 0.5871342910844294 0.4772274783909285 -0.5010883085749486 -0.4200449560593692 1029.2328376522535 2030.3300587656101 2997.191450284511 1 1_1_0_0_0_60_10.png

I then produced a cameras.txt file using one row from a previously automatically generated cameras.txt and replaced the camera ID with 1.

root@jetson:/media/jetson/known_poses# cat cameras.txt
1 SIMPLE_RADIAL 1080 720 1536.59 540 360 -0.0736127

I ran feature_extractor followed by sequential_matcher and then transitive_matcher. All three commands ran successfully. I then ran point_triangulator which was the command that gave me the error.

Expected behavior The point_triangulator should have produced a sparse model from known image pose/orientations.

Console output

root@jetson:/media/jetson/known_poses# colmap point_triangulator --database_path ./database.db --image_path ../images --input_path . --output_path ./sparse

==============================================================================
Loading model
==============================================================================


==============================================================================
Loading database
==============================================================================

Loading cameras... 10549 in 0.091s
Loading matches... 29547 in 1.468s
Loading images... 10549 in 16.857s (connected 9360)
Building correspondence graph... in 6.778s (ignored 0)

Elapsed time: 0.421 [minutes]

F0210 00:27:52.140156 11170 reconstruction.cc:81] Check failed: existing_image.Name() == image.second.Name() (5_7_2_1_0_30_-30.png vs. 5_7_2_1_0_30_-90.png)
*** Check failure stack trace: ***
    @       0x7fb4354128  google::LogMessage::Fail()
    @       0x7fb4355f98  google::LogMessage::SendToLog()
    @       0x7fb4353c90  google::LogMessage::Flush()
    @       0x7fb435683c  google::LogMessageFatal::~LogMessageFatal()
    @       0x55870ab650  (unknown)
    @       0x55871be9ec  (unknown)
    @       0x558700ff44  (unknown)
    @       0x5586ffe814  (unknown)
    @       0x7fb27d16e0  __libc_start_main
    @       0x5587008fd8  (unknown)
Aborted (core dumped)

Environment

jetson@jetson:~$ colmap --help
COLMAP 3.6 -- Structure-from-Motion and Multi-View Stereo
              (Commit 51350b4 on 2020-01-16 with CUDA)
jetson@jetson:~$ uname -a
Linux jetson 4.9.140-tegra #1 SMP PREEMPT Mon Dec 9 22:52:02 PST 2019 aarch64 aarch64 aarch64 GNU/Linux

KhaledSharif avatar Feb 10 '20 18:02 KhaledSharif

Hello I got a similar error. The reason why I met the error is, the image_id in Database Table of images in 'database.db' does not perfectly ordered in image string order. I recommend you to read image_id and image name from database.db and remake images.txt

ComputerMath avatar Feb 10 '20 19:02 ComputerMath

Describe the bug Check fails when attempting point triangulation. I am attempting to reconstruct a sparse/dense model from known camera poses as outlined here.

To Reproduce

I produced an images.txt file with only one camera (camera ID = 1 for all images). The head of the file is shown below.

root@jetson:/media/jetson/known_poses# head images.txt
1 -0.4080619246677543 -0.6198294349978429 0.3076475753717585 0.5955248999954418 1029.2328376522535 2030.3300587656101 2997.191450284511 1 1_1_0_0_0_60_-30.png

2 -0.29845073348239864 -0.6638352739580076 0.1953414655698169 0.6573367482211467 1029.2328376522535 2030.3300587656101 2997.191450284511 1 1_1_0_0_0_60_-50.png

3 -0.17977126778353844 -0.6876708140358151 0.07710000418408751 0.6991757519805962 1029.2328376522535 2030.3300587656101 2997.191450284511 1 1_1_0_0_0_60_-70.png

4 -0.055629543081726185 -0.6906118244073665 -0.04348410181429079 0.7197706543161171 1029.2328376522535 2030.3300587656101 2997.191450284511 1 1_1_0_0_0_60_-90.png

5 0.5871342910844294 0.4772274783909285 -0.5010883085749486 -0.4200449560593692 1029.2328376522535 2030.3300587656101 2997.191450284511 1 1_1_0_0_0_60_10.png

I then produced a cameras.txt file using one row from a previously automatically generated cameras.txt and replaced the camera ID with 1.

root@jetson:/media/jetson/known_poses# cat cameras.txt
1 SIMPLE_RADIAL 1080 720 1536.59 540 360 -0.0736127

I ran feature_extractor followed by sequential_matcher and then transitive_matcher. All three commands ran successfully. I then ran point_triangulator which was the command that gave me the error.

Expected behavior The point_triangulator should have produced a sparse model from known image pose/orientations.

Console output

root@jetson:/media/jetson/known_poses# colmap point_triangulator --database_path ./database.db --image_path ../images --input_path . --output_path ./sparse

==============================================================================
Loading model
==============================================================================


==============================================================================
Loading database
==============================================================================

Loading cameras... 10549 in 0.091s
Loading matches... 29547 in 1.468s
Loading images... 10549 in 16.857s (connected 9360)
Building correspondence graph... in 6.778s (ignored 0)

Elapsed time: 0.421 [minutes]

F0210 00:27:52.140156 11170 reconstruction.cc:81] Check failed: existing_image.Name() == image.second.Name() (5_7_2_1_0_30_-30.png vs. 5_7_2_1_0_30_-90.png)
*** Check failure stack trace: ***
    @       0x7fb4354128  google::LogMessage::Fail()
    @       0x7fb4355f98  google::LogMessage::SendToLog()
    @       0x7fb4353c90  google::LogMessage::Flush()
    @       0x7fb435683c  google::LogMessageFatal::~LogMessageFatal()
    @       0x55870ab650  (unknown)
    @       0x55871be9ec  (unknown)
    @       0x558700ff44  (unknown)
    @       0x5586ffe814  (unknown)
    @       0x7fb27d16e0  __libc_start_main
    @       0x5587008fd8  (unknown)
Aborted (core dumped)

Environment

jetson@jetson:~$ colmap --help
COLMAP 3.6 -- Structure-from-Motion and Multi-View Stereo
              (Commit 51350b4 on 2020-01-16 with CUDA)
jetson@jetson:~$ uname -a
Linux jetson 4.9.140-tegra #1 SMP PREEMPT Mon Dec 9 22:52:02 PST 2019 aarch64 aarch64 aarch64 GNU/Linux

you should make sure your own image id match with the DB image id

LeeC20 avatar Oct 28 '20 10:10 LeeC20

Hello I got a similar error. The reason why I met the error is, the image_id in Database Table of images in 'database.db' does not perfectly ordered in image string order. I recommend you to read image_id and image name from database.db and remake images.txt

That helps a lot. Thanks! In fact, i found colmap adopts the order of string dictionary as its build-in order. For example, images with name ['0', '1', '2', '3', '10', '11', '100', '101', '102'] will be ordered in colmap as: ['0', '1', '10', '100', '101', '102', '11', '2', '3']

Therefore, in python, to keep the same order as the colmap's, one can easily uses

sorted(['0', '1', '2', '3', '10', '11', '100', '101', '102'] )

to get the correct dictionary order.

wen-yuan-zhang avatar Aug 09 '22 14:08 wen-yuan-zhang

no, image order is totally random according to this https://github.com/colmap/colmap/issues/642#issuecomment-508645448

kwea123 avatar Jun 09 '23 10:06 kwea123