Skip to content

cPython Binding Causes Entire Program To Crash in cv2.dnn.NMSBoxes #18856

@EmperorArthur

Description

@EmperorArthur
System information (version)
  • OpenCV => opencv-python-headless 4.4.0.46
  • Operating System / Platform => Ubuntu Linux, x64
Detailed description

Similar to Issue #18835, the Python bindings are failing when calling a function with the wrong arguments.
The major difference is this time it causes the entire Python runtime to crash!

It turns out that the bindings really don't like numpy arrays instead of lists.

Side note, but PyCharm and other linters do not catch the issue since the bindings are not generated with any typing information. It's just run it, and pray that nothing was missed.

Steps to reproduce
import cv2
import numpy
cv2.dnn.NMSBoxes(numpy.empty(0),[],0,0)
Issue submission checklist
  • I report the issue, it's not a question
  • I checked the problem with documentation, FAQ, open issues,
    answers.opencv.org, Stack Overflow, etc and have not found solution
  • I updated to 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

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions