-
-
Notifications
You must be signed in to change notification settings - Fork 56.5k
Type stubs: Optional parameters incorrectly marked as not-None in cv2.calcHist and cv2.resize #23779
Copy link
Copy link
Closed
Description
System Information
OpenCV python: opencv_python_headless-4.7.0+772599a-cp37-abi3-win_amd64.whl
Operating System / Platform: 10.0.19045 Build 19045
Python version: 3.9.13
Detailed description
cv2.calcHist: the mask parameter should accept None
cv2.resize: the dsize parameter should accept None
Steps to reproduce
import cv2
image = cv2.imread("some_path", cv2.IMREAD_UNCHANGED)
# Argument of type "None" cannot be assigned to parameter "dsize" of type "Size" in function "resize"
# Type "None" cannot be assigned to type "Size"PylancereportGeneralTypeIssues
cv2.resize(image, dsize=None)
# Argument of type "None" cannot be assigned to parameter "mask" of type "UMat" in function "calcHist"
# Type "None" cannot be assigned to type "UMat"PylancereportGeneralTypeIssues
cv2.calcHist([image], [0, 1, 2], None, [8, 8, 8], [0, 256, 0, 256, 0, 256])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)
Reactions are currently unavailable