Skip to content

Conversation

@Munna-Manoj
Copy link

Modified MC-Calib to support Double sphere camera model.
It now supports following:

  1. Proper Camera Intrinsics and Pose initialization when using distortion==2(double sphere)
  2. Proper parameter bound during optimization as suggested from ds paper and Basalt library
  3. Updated loss function and iterative outlier rejection as suggested in Kalibr

…mization

Major Features:
- Implement Double Sphere camera model (distortion_model: 2)
  * Projection/unprojection functions in geometrytools.cpp
  * Ceres cost functions in OptimizationCeres.h
  * Robust initialization strategy in Camera.cpp

- Add configurable optimization strategies via optimization_strategy parameter
  * 'original': HuberLoss + single pass (default, backward compatible)
  * 'kalibr': CauchyLoss + iterative outlier rejection (robust)

- Basalt-inspired improvements
  * Parameter bounds enforcement (xi ∈ [-1,1], alpha ∈ [0,1])
  * Geometric validity checks
  * Numerical stability improvements

Performance:
- 88-96% error reduction vs initial DS implementation
- 1-60% additional improvement with Kalibr strategy
- Tested across 7 synthetic scenarios

Modified Files:
- Core: Camera.cpp/hpp, CameraGroup.cpp/hpp, McCalib.cpp/hpp
- Optimization: OptimizationCeres.h, geometrytools.cpp
- Configs: All *_DS*.yml files (original + Kalibr variants)
- Docs: README.md with usage instructions
- Tools: benchmark.sh, benchmark_optimization.py

Breaking Changes: None (backward compatible, defaults to original strategy)

See final_report.md for complete details and benchmark results.
…mization

Major Features:
- Implement Double Sphere camera model (distortion_model: 2)
  * Projection/unprojection in geometrytools.cpp
  * Ceres cost functions in OptimizationCeres.h
  * Robust initialization in Camera.cpp

- Add configurable optimization strategies
  * 'original': HuberLoss + single pass (default)
  * 'kalibr': CauchyLoss + iterative outlier rejection

- Basalt-inspired improvements
  * Parameter bounds (xi∈[-1,1], alpha∈[0,1])
  * Geometric validity checks
  * Numerical stability

Performance:
- 88-96% error reduction vs initial DS
- 1-60% improvement with Kalibr strategy
- Tested on 7 synthetic scenarios

Modified: Camera.cpp/hpp, CameraGroup.cpp/hpp, McCalib.cpp/hpp,
          OptimizationCeres.h, geometrytools.cpp, README.md
Added: Config files (*_DS*.yml), benchmark scripts

Backward compatible (defaults to original strategy)
Apply Google-style formatting using clang-format version 11 to resolve
CI test failures in the pull request.

Changes:
- Added .clang-format configuration (Google style, 2-space indent)
- Formatted 35 C++ files in McCalib core, apps, and tests
- Include reordering for standard library consistency
- Multi-line parameter alignment for better readability
- Comment spacing alignment

Impact:
- 782 insertions, 734 deletions (net +48 lines from reformatting)
- Zero functional code changes - purely cosmetic formatting
- All tests pass: KB model, DS with original/Kalibr strategies
- Build verified in Release mode without errors

Tested:
- Kannala-Brandt model: 0.0299px reprojection error
- Double Sphere (original): 1.0659px reprojection error
- Double Sphere (Kalibr): 0.9918px reprojection error

This commit resolves the clang-format-lint CI test failure while
maintaining full backward compatibility and test coverage.
@Munna-Manoj
Copy link
Author

I updated the codebase to meet the clang-format-lint issue.

@BAILOOL
Copy link
Collaborator

BAILOOL commented Dec 17, 2025

Hi @Munna-Manoj,

Thank you very much for the contributions.

This PR is a bit lengthy to review properly. Do you think we can split it into several independent PRs for easier reviews? For example the three contributions stated in the PR description might be an independent PRs. Is my understanding correct?

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

Successfully merging this pull request may close these issues.

2 participants