Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typing of compare does not allow scalar for src1 or src2 #1008

Open
4 tasks done
damonmaria opened this issue Jun 22, 2024 · 0 comments
Open
4 tasks done

Typing of compare does not allow scalar for src1 or src2 #1008

damonmaria opened this issue Jun 22, 2024 · 0 comments
Assignees

Comments

@damonmaria
Copy link

Expected behaviour

The following code should be shown as valid:
cv2.compare(some_array, 10, cv2.CMP_EQ)

Although the docs for compare show the type of src1 and src2 to be InputArray, the description of the parameters says "input array or a scalar; when it is an array, it must have a single channel" and passing an int does work.

Actual behaviour

The int (10) is shown as a error because the pyi only allows src1 and src2 to be UMat/MatLike.

Steps to reproduce

  • example code: above code shows this error
  • opencv-python version: 4.10.0.84
Issue submission checklist
  • This is not a generic OpenCV usage question (looking for help for coding, other usage questions, homework etc.)
  • I have read the README of this repository and understand that this repository provides only an automated build toolchain for OpenCV Python packages (there is no actual OpenCV code here)
  • The issue is related to the build scripts in this repository, to the pre-built binaries or is a feature request (such as "please enable this additional dependency")
  • I'm using the latest version of opencv-python
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants