Skip to content

Python binding for subclasses of TextDetectionModel crashes the program #19346

@mikr

Description

@mikr

Running the following lines with a proper model and frame crashes:

detector = cv.dnn_TextDetectionModel_DB(model=model)
result = detector.detectTextRectangles(frame)

Changing the export type of TextDetectionModel from

class CV_EXPORTS_W TextDetectionModel : public Model

to

class CV_EXPORTS_W_SIMPLE TextDetectionModel : public Model

and recompiling and reinstalling the Python bindings fixes the crash for me
and detector.detectTextRectangles(frame) returns the correct results.

System information (version)
  • OpenCV => 4.5.1

  • Operating System / Platform => macOS 10.15.7

  • Compiler => Apple clang version 12.0.0 (clang-1200.0.32.28)

  • Python 3.9.1

  • 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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions