opencv / opencv

Open Source Computer Vision Library
https://opencv.org
Apache License 2.0
76.54k stars 55.64k forks source link

QRCodeEncoder segfault #25588

Closed neonknight closed 1 month ago

neonknight commented 1 month ago

System Information

OpenCV python version: 4.9.0.80 (headless, via pip) Operating System / Platform: Debian 12.5 Python version: 3.11.2

Detailed description

When trying to create a QR code using QRCodeEncoder the python shell/application is terminated with Segmentation fault

Steps to reproduce

python3 -m venv opencv
. opencv/bin/activate
pip install opencv-python-headless
pip install opencv-contrib-python-headless
python3
import cv2
encoder = cv2.QRCodeEncoder()
qrcode = encoder.encode('foobar')

Issue submission checklist

asmorkalov commented 1 month ago

C++ code use ::create() factory to create the object. Python code have to call QRCodeEncoder_create() to achieve the same result. It's true for classes inherited from cv::Algorithm.