opencv/modules/python/src2
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
..
typing_stubs_generation Merge pull request #27620 from killerdevildog:fix-scalar-typing-issue-27528 2025-09-10 16:47:12 +03:00
copy_typings_stubs_on_success.py Merge pull request #20370 from ddacw:stub-gen-next 2023-05-26 18:25:46 +03:00
cv2_convert.cpp Fix memory leaks in pybindings 2025-09-02 17:35:41 +02:00
cv2_convert.hpp Merge pull request #27284 from dkurt:java_video_capture_read 2025-05-14 17:01:45 +03:00
cv2_highgui.cpp Merge pull request #21182 from mshabunin:split-cv2cpp 2021-12-05 12:49:36 +00:00
cv2_highgui.hpp Merge pull request #21182 from mshabunin:split-cv2cpp 2021-12-05 12:49:36 +00:00
cv2_numpy.cpp Replace static numpy allocator by function containing static. 2024-04-26 14:38:18 +02:00
cv2_numpy.hpp Replace static numpy allocator by function containing static. 2024-04-26 14:38:18 +02:00
cv2_util.cpp Merge pull request #23736 from seanm:c++11-simplifications 2024-01-19 16:53:08 +03:00
cv2_util.hpp Fixed tests execution with Python 2.7 2023-07-11 18:24:08 +03:00
cv2.cpp Merge pull request #27284 from dkurt:java_video_capture_read 2025-05-14 17:01:45 +03:00
cv2.hpp Merge pull request #25810 from fengyuentau:python/fix_parsing_3d_mat_in_dnn 2024-07-04 08:33:20 +03:00
gen2.py Merge pull request #27581 from dkurt:d.kuryaev/dlpack 2025-08-20 11:43:41 +03:00
hdr_parser.py Fixed ifdef logic operators evaluation with some old python versions. 2025-06-25 10:35:53 +03:00
pycompat.hpp Merge pull request #24426 from dkurt:qrcode_eci_encoding 2025-06-19 10:12:15 +03:00
typing_stubs_generator.py Merge pull request #23801 from VadimLevin:dev/vlevin/python-stubs-api-refinement 2023-06-21 10:44:36 +03:00