opencv/modules/python
Quaylyn Rimer 1fdff6da75
Merge pull request #27620 from killerdevildog:fix-scalar-typing-issue-27528
Fix Python Scalar typing issue #27528 #27620

- Add ScalarInput and ScalarOutput types for better type safety
- ScalarInput: Union[Sequence[float], float] for function parameters
- ScalarOutput: Sequence[float] for function return values
- Keep original Scalar type for backwards compatibility (deprecated)
- Add refinement functions to apply new types to specific functions
- Functions returning scalars now use ScalarOutput (mean, sumElems, trace)
- Drawing functions now use ScalarInput for color parameters
- Resolves MyPy compatibility issues with scalar return values
- Maintains full backwards compatibility

closes #27528 

### Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

- [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
      Patch to opencv_extra has the same branch name.
- [x ] The feature is well documented and sample code can be built with the project CMake
2025-09-10 16:47:12 +03:00
..
bindings Fixed bug in ifdef state machine in header parser for bindings. 2025-06-02 12:41:39 +03:00
package pre: OpenCV 4.12.0 (version++). 2025-06-19 11:03:59 +03:00
python2 python: support standalone Python bindings build 2018-06-07 15:16:39 +03:00
python3 Manage Python Limited API version externally. 2024-01-10 12:30:29 +03:00
src2 Merge pull request #27620 from killerdevildog:fix-scalar-typing-issue-27528 2025-09-10 16:47:12 +03:00
test Merge pull request #27581 from dkurt:d.kuryaev/dlpack 2025-08-20 11:43:41 +03:00
CMakeLists.txt Fix configuring with CMake version 4 2025-04-02 13:45:08 -07:00
common.cmake Manage Python Limited API version externally. 2024-01-10 12:30:29 +03:00
python_loader.cmake [python][cuda] Update CUDA shared library location for CUDA Toolkit 13.0 2025-08-13 21:59:59 +03:00
standalone.cmake python: update CMake install rules 2019-03-15 13:11:00 +03:00