-
-
Notifications
You must be signed in to change notification settings - Fork 829
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
Check failed: size == existing_size Core dumped #434
Comments
After some code analysis I added two logs in BundleAdjustmentCeres.cpp at about line 283 and line 404. 283
404
Here is the out put:
|
Some more info about the gdb stack trace and the code analytics. #0 0x00007f010397cc37 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56 AnalysisThe error occurs at ceres problem_impl.cc line 101.
So the size compare is between the size of stored params in parameter_block_map_(existing_size) and the second param (int size) which is passed in. Trace of those two values: 1. BundleAdjustmentCeres.cpp at about line 282 Pointer 0x627b950 which points to one of sfm_data's intrinsic params, was the first added to map_intrinsics.
Function AddParameterBlock will call ceres's function InternalAddParameterBlock. 2. BundleAdjustmentCeres.cpp at about line 404
The third param &map_intrinsics[view->getIntrinsicId()][0] is just the same pointer 0x627b950, which is the former intrinsic params.
So from the error we know the parameter_block_sizes[i] is 3. Trace back the second param parameter_block_sizes[i], it was somethig about
The cost function was created by BundleAdjustmentCeres.cpp at about line 403:
If the trace is correct, parameter_block_sizes() will return one internal value which is initalized during the definition of the cost function. I'm sure we are using the PINHOLE_CAMERA modal across all images. So the value 3 is the intrinsics size, i.e. the second number at line 26:
Finally, seems that those two values should not match proberbly because they have different meanning. Perhaps one is the real size of intrinsics and the other is the size of target intrinsics to be optimized? I have no idea which is correct during BundleAdjustment. The same problem may exist in LocalBundleAdjustmentCeres.cpp. Hope this info will hlep. Thx. |
Hi, Thank you for your detail analysis. |
Hi, PS Although distortionParams are zeros, they are add to camera model at Pinhole.hpp line 112
so the result vector size of getParams() will return 7, which will not match size 3 defined by the pinhole cost function? |
Do you manually changed the camera model on the CameraInit to Pinhole in Meshroom? |
@fabiencastan yes, is it should remains to be unchanged? |
No, you are correct, it is definitely a bug! There is an old PR to fix it that has never been merged. |
I just tried your dataset and it works for me with the PR. |
It's now merged in the "develop" branch. |
Fixed with #347 |
Core dumped at structure from motion step.
BUG
Problem
[13:57:31.642496][info] AutomaticInitialPairChoice, test I: 2130908429, J: 2146485851, nbCommonTracks: 308
*
[13:57:31.643868][info] AutomaticInitialPairChoice, test I: 2140548709, J: 2146485851, nbCommonTracks: 140
[13:57:31.682983][info] Initial pair is:
A - view id: 77159844 - filepath: /home/zj/data/szyl_segment/images/DJI_0158.JPG
B - view id: 793985669 - filepath: /home/zj/data/szyl_segment/images/DJI_0160.JPG
[13:57:31.683931][info] 802 matches in the image pair for the initial pose estimation.
problem_impl.cc:101 Check failed: size == existing_size Tried adding a parameter block with the same double pointer, 0x165d370, twice, but with different block sizes. Original size was 7 but new size is 3
Aborted (core dumped)
Conditions
Prepare data set with more than 100 images. Problem may not occur if the amount of images is small.
I've tried with amount 3, 29 and 120, only the 120 dataset failed with image size 5472x3648.
Steps to Reproduce
Versions
The text was updated successfully, but these errors were encountered: