Skip to content

cudaarithm: binary operations involving a scalar don't work in python #3814

Closed
@cudawarped

Description

@cudawarped
System information (version)
  • OpenCV => 4.10
  • Operating System / Platform => Windows/Linux
  • Compiler =>
Detailed description

The overloads for the binary operations involving a matrix and a scalar are missing. This reults in the following types of error

cv2.error: OpenCV(4.10.0) :-1: error: (-5:Bad argument) in function 'divide'
> Overload resolution failed:
>  - src1 is not a numpy array, neither a scalar
>  - Expected Ptr<cv::cuda::GpuMat> for argument 'src2'
>  - Expected Ptr<cv::UMat> for argument 'src1'
Steps to reproduce
cu_test = cv2.cuda_GpuMat(4, 4, cv2.CV_8UC1, 16)
test = cu_test.download()
print(test)
cu_test = cv2.cuda.divide(cu_test, 2)
test = cu_test.download()
print(test)

See issue raised on the forum.

Issue submission checklist
  • I report the issue, it's not a question
  • I checked the problem with documentation, FAQ, open issues,
    forum.opencv.org, Stack Overflow, etc and have not found any solution
  • I updated to the latest OpenCV version and the issue is still there
  • There is reproducer code and related data files: videos, images, onnx, etc

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions