Merged
Conversation
/memories/repo/openptv-python-2026-03-07-handoff.md.
…mentation and image processing
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…thon into merge_openptv
Contributor
There was a problem hiding this comment.
Pull request overview
This large PR modernizes openptv-python by updating Python version support (3.12/3.13), adding a native optv compatibility layer for optional delegation of image preprocessing and target recognition, rewriting core image processing functions to match native C behavior, fixing multi-layer multimedia refraction and angle computation bugs, adding a synthetic test cavity case for bundle adjustment validation, and updating CI/CD workflows and tooling.
Changes:
- Added
_native_compat.pyand_native_convert.pyfor optional nativeoptvbackend delegation, rewritingimage_processing.py(box blur, lowpass, subtract) andsegmentation.pyto match liboptv behavior, with parity tests. - Fixed
multimed.pyper-layer refraction loop,parameters.pyset_layersnlay sync, andtrack.pyangle_acccosine clamping and zero-norm guard. - Added comprehensive synthetic cavity test case data,
calibration_compare.pyutility, new tests, and updated CI to Python 3.12/3.13 with modernized GitHub Actions and pre-commit hooks.
Reviewed changes
Copilot reviewed 95 out of 98 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| openptv_python/_native_compat.py | New optional import layer for optv native modules |
| openptv_python/_native_convert.py | Conversion helpers between Python and native optv objects |
| openptv_python/calibration_compare.py | New CLI tool for comparing calibration folders |
| openptv_python/image_processing.py | Rewritten box blur, lowpass, subtract to match native C; native delegation |
| openptv_python/segmentation.py | Native target recognition delegation for full-frame case |
| openptv_python/parameters.py | Fix set_layers to update nlay |
| openptv_python/multimed.py | Fix per-layer refraction loop for multi-layer case |
| openptv_python/track.py | Fix angle_acc with cosine clamping and zero-norm guard |
| openptv_python/tracking_frame_buf.py | Pre-check file existence in Frame.read |
| tests/test_synthetic_cavity_case.py | Bundle adjustment recovery tests on synthetic data |
| tests/test_segmentation.py | Native vs Python parity test for target recognition |
| tests/test_image_processing.py | Corrected expected values; native parity test |
| tests/test_point_positions.py | Multi-camera reconstruction parity tests |
| tests/test_multimedia_n_lay.py | Multi-layer refraction and reconstruction parity tests |
| tests/test_calibration_compare.py | Tests for calibration comparison utility |
| tests/test_read_frame.py | Test for missing linkage file handling |
| tests/test_tracking.py | Additional angle_acc test case |
| tests/testing_fodder/test_cavity_synthetic/* | Synthetic test fixture data files |
| tests/testing_fodder/test_cavity/parameters_Run1.yaml | YAML parameters for test cavity |
| pyproject.toml | Updated Python versions, dependencies, optional extras |
| Makefile | Configurable Python interpreter |
| Dockerfile | Updated to Python 3.12 |
| .pre-commit-config.yaml | Updated hook versions |
| .github/workflows/* | Updated Actions versions and Python versions |
| docs/conf.py, docs/index.md | Optional autoapi, updated docs |
| README.md | Expanded backend/installation documentation |
| mypy.ini, .gitignore, .cruft.json, ci/environment-ci.yml | Minor config updates |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request modernizes the development, testing, and installation workflows for
openptv-python, focusing on Python version updates, backend flexibility, and improved documentation. It introduces support for Python 3.12 and 3.13, adds a compatibility layer for nativeoptvbindings, and significantly enhances the README and developer documentation to clarify backend selection and installation methods. The CI/CD pipeline is updated for newer GitHub Actions and Python versions, and pre-commit hooks are refreshed for better code quality.Python Version and Backend Support
>=3.12,<3.14). [1] [2] [3] [4]_native_compat.pymodule to provide an optional compatibility layer for nativeoptvbindings, enabling automatic delegation to native implementations for image preprocessing and target recognition when available.optv), installation methods (uv,pip,conda), and backend capability matrix. (F6466639L1R1, [1] [2]CI/CD and Tooling Modernization
.github/workflowsto their latest major versions (e.g.,actions/checkout@v6,actions/setup-python@v6,actions/download-artifact@v7,actions/upload-artifact@v6), and switched CI jobs to use Python 3.12/3.13. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12]types-PyYAMLto development dependencies for better type checking.python -mfor all tooling calls, ensuring compatibility with virtual environments.Documentation and Linting
README.mdanddocs/index.md. (F6466639L1R1, [1] [2]autoapiextension optional via an environment variable to avoid unnecessary build requirements for users.mypy.inito exclude build and temporary directories from type checks.Template and Dependency Updates
cookiecutter-conda-package. [1] [2]These changes collectively make the project easier to install, develop, and contribute to, while ensuring robust backend flexibility and modern development practices.