4 Commits
Author SHA1 Message Date
yehsin b8f84264fb Merge pull request #30144 from Yehsin0815:fix-odometry-python-sample
samples: fix Python odometry sample for 5.x bindings - #30144

Fixes #30143

`samples/python/odometry.py` fails on 5.x:

- It uses `cv.DEPTH`, `cv.RGB` and `cv.RGB_DEPTH`, which the Python bindings don't export. The enum values are exposed as `cv.OdometryType_*`, the same names `modules/ptcloud/misc/python/test_odometry.py` uses. Every mode fails with `AttributeError`.
- RGB mode calls `compute(rgb1, rgb2, Rt)`, and that overload always raises "This odometry algorithm requires depth and rgb data simultaneously" (`modules/ptcloud/src/odometry.cpp`). The sample now loads the depth frames in RGB mode too and uses the 5-argument overload.

Tested with opencv-python 5.0.0.93 on Windows 11 and Linux: `--algo DEPTH`, `RGB`, `RGB_DEPTH` and the default (all modes) each run and print `Rt`.

This change was prepared with the help of an AI coding tool; I reviewed it and reproduced the bug and the fix locally.

### Pull Request Readiness Checklist

- [x] I agree to contribute to the project under Apache 2 License.
- [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
- [x] The PR is proposed to the proper branch
- [x] There is a reference to the original bug report and related work
- [ ] There is accuracy test, performance test and test data in opencv_extra repository, if applicable
- [ ] The feature is well documented and sample code can be built with the project CMake
2026-10-05 14:34:13 +03:00
Rostislav Vasilikhin 4e1ce3e0eb odometry python sample got rid of scale parameter 2022-06-23 23:51:16 +02:00
Saratovtsev df490c6399 moving code from ICP+Scale 2022-06-14 13:40:14 +02:00
Artem Saratovtsev 4ba2b05df8 Merge pull request #21439 from DumDereDum:python_odometry
Odometry python support
2022-02-07 16:16:17 +00:00