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

I can't impose the poses of my cameras during SFM step #725

Closed
Zat-Code opened this issue Dec 9, 2019 · 4 comments
Closed

I can't impose the poses of my cameras during SFM step #725

Zat-Code opened this issue Dec 9, 2019 · 4 comments
Labels
stale for issues that becomes stale (no solution)

Comments

@Zat-Code
Copy link

Zat-Code commented Dec 9, 2019

Hi,
I created a python pipeline that allows me to calibrate 3 cameras using a chessboard target. So I have my 3x3 rotation matrix and my 3x1 translation matrix for each camera.

I have a python script that runs a first reconstruction ( CameraInit, Feature Extraction, Image Matching, Image Matching, StructureFromMotion) using 3 photos (one image corresponds to a previously calibrated camera).

I then have a python script that will create a new file new_cameras.sfm that corresponds to the cameras.sfm file of the first reconstruction but with the new camera poses (I replaced the "poses" field of each camera with my transformation matrix).

I restart the sfm step from the new new_cameras.sfm file.

I get the following logs:

C:/Users/Utilisateur/Documents/Meshroom-2019.2.0/aliceVision/bin\aliceVision_incrementalSfm.exe --minAngleForLandmark 2.0 --minNumberOfObservationsForTriangulation 2 --maxAngleInitialPair 80.0 --maxNumberOfMatches 0 --localizerEstimator acransac --describerTypes sift --lockScenePreviouslyReconstructed True --localBAGraphDistance 1 --interFileExtension .abc --useLocalBA False --minInputTrackLength 2 --lockAllIntrinsics True --useRigConstraint True --localizerEstimatorMaxIterations 4096 --localizerEstimatorError 0.0 --useOnlyMatchesFromInputFolder False --verboseLevel debug --minAngleForTriangulation 3.0 --maxReprojectionError 4.0 --minAngleInitialPair 5.0 --input "C:/Users/Utilisateur/Pictures/calibration/test_chessboard/test/04_StructureFromMotion/new_cameras.sfm" --featuresFolders "C:/Users/Utilisateur/Pictures/calibration/test_chessboard/test/01_FeatureExtraction/" --matchesFolders "C:/Users/Utilisateur/Pictures/calibration/test_chessboard/test/03_FeatureMatching" --outputViewsAndPoses "C:/Users/Utilisateur/Pictures/calibration/test_chessboard/test/05_StructureFromMotion_pos_camera/cameras.sfm" --extraInfoFolder "C:/Users/Utilisateur/Pictures/calibration/test_chessboard/test/05_StructureFromMotion_pos_camera" --output "C:/Users/Utilisateur/Pictures/calibration/test_chessboard/test/05_StructureFromMotion_pos_camera/bundle.sfm"
Program called with the following parameters:

  • describerTypes = "sift"
  • extraInfoFolder = "C:/Users/Utilisateur/Pictures/calibration/test_chessboard/test/05_StructureFromMotion_pos_camera"
  • featuresFolders = = [C:/Users/Utilisateur/Pictures/calibration/test_chessboard/test/01_FeatureExtraction/]
  • initialPairA = "" (default)
  • initialPairB = "" (default)
  • input = "C:/Users/Utilisateur/Pictures/calibration/test_chessboard/test/04_StructureFromMotion/new_cameras.sfm"
  • interFileExtension = ".abc"
  • localBAGraphDistance = 1
  • localizerEstimator = Unknown Type "enum aliceVision::robustEstimation::ERobustEstimator"
  • localizerEstimatorError = 0
  • localizerEstimatorMaxIterations = 4096
  • lockAllIntrinsics = 1
  • lockScenePreviouslyReconstructed = 1
  • matchesFolders = = [C:/Users/Utilisateur/Pictures/calibration/test_chessboard/test/03_FeatureMatching]
  • maxAngleInitialPair = 80
  • maxNumberOfMatches = 0
  • maxReprojectionError = 4
  • minAngleForLandmark = 2
  • minAngleForTriangulation = 3
  • minAngleInitialPair = 5
  • minInputTrackLength = 2
  • minNumberOfObservationsForTriangulation = 2
  • output = "C:/Users/Utilisateur/Pictures/calibration/test_chessboard/test/05_StructureFromMotion_pos_camera/bundle.sfm"
  • outputViewsAndPoses = "C:/Users/Utilisateur/Pictures/calibration/test_chessboard/test/05_StructureFromMotion_pos_camera/cameras.sfm"
  • useLocalBA = 0
  • useOnlyMatchesFromInputFolder = 0
  • useRigConstraint = 1
  • useTrackFiltering = 1 (default)
  • verboseLevel = "debug"

Loading features
0% 10 20 30 40 50 60 70 80 90 100%
|----|----|----|----|----|----|----|----|----|----|
[14:47:38.879851][info] Supported CUDA-Enabled GPU detected.
*********************************[14:47:38.898840][debug] Loading matches
[14:47:38.899839][debug] Loading match file: C:/Users\Utilisateur\Pictures\calibration\test_chessboard\test\03_FeatureMatching\matches.txt
[14:47:38.900840][debug] Track building


[14:47:38.901839][debug] Track filtering
[14:47:38.902842][debug] Track export to internal structure
[14:47:38.902842][debug] Build tracks per view
[14:47:38.902842][debug] Build tracks pyramid per view
[14:47:38.903841][info] Fuse matches into tracks:
- # tracks: 461
- # images in tracks: 3
[14:47:38.904843][info] TrackLength, Occurrence
[14:47:38.904843][info] 2 396
[14:47:38.904843][info] 3 65
[14:47:38.904843][debug] Triangulating (mode: multi-view LO-RANSAC)...
[14:47:38.925827][debug] Triangulation of the 3 newly reconstructed views took 20 msec.
[14:47:38.925827][info] Bundle adjustment start.
[14:47:38.925827][debug] BundleAdjustment[Ceres]: DENSE_SCHUR
[14:47:38.925827][debug] BundleAdjustment[Ceres]: DENSE_SCHUR
[14:47:38.925827][info] Start bundle adjustment iteration: 0
[14:47:38.928823][warning] Bundle Adjustment failed, the solution is not usable.
[14:47:38.928823][info] Begin Incremental Reconstruction:
- mode: SfM augmentation
- # images in input: 3
- # images in resection: 0
- # landmarks in input: 396
- # cameras already calibrated: 3
[14:47:38.929823][info] Incremental Reconstruction start iteration 0:
- # number of resection groups: 0
- # number of poses: 3
- # number of landmarks: 396
- # remaining images: 0
[14:47:38.929823][debug] FindConnectedViews does not find connected new views
[14:47:38.929823][info] Incremental Reconstruction completed with 1 iterations:
- # number of resection groups: 0
- # number of poses: 3
- # number of landmarks: 396
- # remaining images: 0
[14:47:38.929823][info] Structure from Motion statistics:
- # input images: 3
- # cameras calibrated: 3
- # poses: 3
- # landmarks: 396
- elapsed time: 0
- residual RMSE: nan

what does the error Bundle Adjustment failed, the solution is not usable mean and how can I solve it ?

@Zat-Code
Copy link
Author

Zat-Code commented Dec 9, 2019

I have resolve the Bundle Adjustement failed, but i have a new error.

C:/Users/Utilisateur/Documents/Meshroom-2019.2.0/aliceVision/bin\aliceVision_incrementalSfm.exe --minAngleForLandmark 2.0 --minNumberOfObservationsForTriangulation 2 --maxAngleInitialPair 80.0 --maxNumberOfMatches 0 --localizerEstimator acransac --describerTypes sift --lockScenePreviouslyReconstructed False --localBAGraphDistance 1 --interFileExtension .abc --useLocalBA False --minInputTrackLength 2 --lockAllIntrinsics True --useRigConstraint True --localizerEstimatorMaxIterations 4096 --localizerEstimatorError 0.0 --useOnlyMatchesFromInputFolder False --verboseLevel debug --minAngleForTriangulation 3.0 --maxReprojectionError 4.0 --minAngleInitialPair 5.0 --input "C:/Users/Utilisateur/Pictures/calibration/test_chessboard/test/04_StructureFromMotion/new_cameras.sfm" --featuresFolders "C:/Users/Utilisateur/Pictures/calibration/test_chessboard/test/01_FeatureExtraction/" --matchesFolders "C:/Users/Utilisateur/Pictures/calibration/test_chessboard/test/03_FeatureMatching" --outputViewsAndPoses "C:/Users/Utilisateur/Pictures/calibration/test_chessboard/test/05_StructureFromMotion_pos_camera/cameras.sfm" --extraInfoFolder "C:/Users/Utilisateur/Pictures/calibration/test_chessboard/test/05_StructureFromMotion_pos_camera" --output "C:/Users/Utilisateur/Pictures/calibration/test_chessboard/test/05_StructureFromMotion_pos_camera/bundle.sfm"
Program called with the following parameters:

  • describerTypes = "sift"
  • extraInfoFolder = "C:/Users/Utilisateur/Pictures/calibration/test_chessboard/test/05_StructureFromMotion_pos_camera"
  • featuresFolders = = [C:/Users/Utilisateur/Pictures/calibration/test_chessboard/test/01_FeatureExtraction/]
  • initialPairA = "" (default)
  • initialPairB = "" (default)
  • input = "C:/Users/Utilisateur/Pictures/calibration/test_chessboard/test/04_StructureFromMotion/new_cameras.sfm"
  • interFileExtension = ".abc"
  • localBAGraphDistance = 1
  • localizerEstimator = Unknown Type "enum aliceVision::robustEstimation::ERobustEstimator"
  • localizerEstimatorError = 0
  • localizerEstimatorMaxIterations = 4096
  • lockAllIntrinsics = 1
  • lockScenePreviouslyReconstructed = 0
  • matchesFolders = = [C:/Users/Utilisateur/Pictures/calibration/test_chessboard/test/03_FeatureMatching]
  • maxAngleInitialPair = 80
  • maxNumberOfMatches = 0
  • maxReprojectionError = 4
  • minAngleForLandmark = 2
  • minAngleForTriangulation = 3
  • minAngleInitialPair = 5
  • minInputTrackLength = 2
  • minNumberOfObservationsForTriangulation = 2
  • output = "C:/Users/Utilisateur/Pictures/calibration/test_chessboard/test/05_StructureFromMotion_pos_camera/bundle.sfm"
  • outputViewsAndPoses = "C:/Users/Utilisateur/Pictures/calibration/test_chessboard/test/05_StructureFromMotion_pos_camera/cameras.sfm"
  • useLocalBA = 0
  • useOnlyMatchesFromInputFolder = 0
  • useRigConstraint = 1
  • useTrackFiltering = 1 (default)
  • verboseLevel = "debug"

Loading features
0% 10 20 30 40 50 60 70 80 90 100%
|----|----|----|----|----|----|----|----|----|----|
[15:13:38.823118][info] Supported CUDA-Enabled GPU detected.


[15:13:38.844093][debug] Loading matches
[15:13:38.845092][debug] Loading match file: C:/Users\Utilisateur\Pictures\calibration\test_chessboard\test\03_FeatureMatching\matches.txt
[15:13:38.846094][debug] Track building
[15:13:38.846094][debug] Track filtering
[15:13:38.848092][debug] Track export to internal structure
[15:13:38.848092][debug] Build tracks per view
[15:13:38.848092][debug] Build tracks pyramid per view
[15:13:38.849092][info] Fuse matches into tracks:
- # tracks: 461
- # images in tracks: 3
[15:13:38.849092][info] TrackLength, Occurrence
[15:13:38.849092][info] 2 396
[15:13:38.849092][info] 3 65
[15:13:38.849092][debug] Triangulating (mode: multi-view LO-RANSAC)...
[15:13:38.875075][debug] Triangulation of the 3 newly reconstructed views took 26 msec.
[15:13:38.876074][info] Bundle adjustment start.
[15:13:38.876074][debug] BundleAdjustment[Ceres]: DENSE_SCHUR
[15:13:38.876074][debug] BundleAdjustment[Ceres]: DENSE_SCHUR
[15:13:38.876074][info] Start bundle adjustment iteration: 0
[15:13:38.886068][info] Bundle Adjustment Statistics:
- local strategy enabled: no
- adjustment duration: 0.0009246 s
- poses:
- # refined: 3
- # constant: 0
- # ignored: 0
- landmarks:
- # refined: 6
- # constant: 0
- # ignored: 0
- intrinsics:
- # refined: 0
- # constant: 1
- # ignored: 0
- # residual blocks: 12
- # successful iterations: 3
- # unsuccessful iterations: 0
- initial RMSE: 1.8242
- final RMSE: 4.38452e-07
[15:13:38.886068][info] Remove outliers:
- # outliers residual error: 0
- # outliers angular error: 0
[15:13:38.886068][debug] eraseUnstablePoses: 3
[15:13:38.886068][info] Bundle adjustment iteration: 0 took 10 msec.
[15:13:38.886068][info] Bundle adjustment with 1 iterations took 10 msec.
[15:13:38.886068][info] Begin Incremental Reconstruction:
- mode: SfM creation

[15:13:38.886068][info] Incremental Reconstruction start iteration 0:
- # number of resection groups: 0
- # number of poses: 0
- # number of landmarks: 0
- # remaining images: 3
[15:13:38.886068][debug] FindConnectedViews does not find connected new views
[15:13:38.886068][info] Incremental Reconstruction completed with 1 iterations:
- # number of resection groups: 0
- # number of poses: 0
- # number of landmarks: 0
- # remaining images: 3
[15:13:38.886068][info] Structure from Motion statistics:
- # input images: 3
- # cameras calibrated: 0
- # poses: 0
- # landmarks: 0
- elapsed time: 0
- residual RMSE: -nan(ind)
[15:13:38.886068][info] Histogram of residuals:

0 | 0
0.1 | 0
0.2 | 0
0.3 | 0
0.4 | 0
0.5 | 0
0.6 | 0
0.7 | 0
0.8 | 0
0.9 | 0
1

[15:13:38.886068][info] Histogram of observations length:

0 | 0
0.1 | 0
0.2 | 0
0.3 | 0
0.4 | 0
0.5 | 0
0.6 | 0
0.7 | 0
0.8 | 0
0.9 | 0
1

[15:13:38.886068][info] Histogram of nb landmarks per view:

0 | 0
0 | 0
0 | 0
0 | 0
0 | 0
0 | 0
0 | 0
0 | 0
0 | 0
0 | 0
1

@natowi
Copy link
Member

natowi commented Feb 24, 2020

Take a look at the discussion here #788
and the wiki https://github.com/alicevision/meshroom/wiki/Using-known-camera-positions
You are welcome to update the wiki.

@stale
Copy link

stale bot commented Jun 23, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale for issues that becomes stale (no solution) label Jun 23, 2020
@stale
Copy link

stale bot commented Jul 1, 2020

This issue is closed due to inactivity. Feel free to re-open if new information is available.

@stale stale bot closed this as completed Jul 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale for issues that becomes stale (no solution)
Projects
None yet
Development

No branches or pull requests

2 participants