You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Camera: PiCamera2 with libcamera v0.5.0, libpisp version v1.2.1
Description
When running ArUco marker detection on Raspberry Pi using the OpenCV 4.6.0 API methods, the program crashes with a segmentation fault. The crash happens specifically during the cv2.aruco.detectMarkers() call.
Steps to Reproduce
Set up a Python script that uses OpenCV's ArUco detection
Use the ArUco's: cv2.aruco.getPredefinedDictionary() and cv2.aruco.DetectorParameters()
Call cv2.aruco.detectMarkers() with the created dictionary and parameters
The program crashes with SIGSEGV at a very low memory address (0x60)
Crash Information
When run with strace, the program shows the following crash pattern:
[DEBUG timestamp] Memory usage before detection: 174.37109375 MB
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0x60} ---
+++ killed by SIGSEGV +++
Workaround
The issue can be resolved by using the older ArUco API functions:
Use cv2.aruco.Dictionary_get() instead of cv2.aruco.getPredefinedDictionary()
Use cv2.aruco.DetectorParameters_create() instead of cv2.aruco.DetectorParameters()
Code Sample to Reproduce
importcv2importnumpyasnp# Setup camera and capture frame# ...# This crashes on ARM/Raspberry Piaruco_dict=cv2.aruco.getPredefinedDictionary(cv2.aruco.DICT_5X5_50)
parameters=cv2.aruco.DetectorParameters()
corners, ids, rejected=cv2.aruco.detectMarkers(gray_image, aruco_dict, parameters=parameters)
# This works (using older API)dictionary=cv2.aruco.Dictionary_get(cv2.aruco.DICT_5X5_50)
parameters=cv2.aruco.DetectorParameters_create()
corners, ids, rejected=cv2.aruco.detectMarkers(gray_image, dictionary, parameters=parameters)
The text was updated successfully, but these errors were encountered:
Environment
Description
When running ArUco marker detection on Raspberry Pi using the OpenCV 4.6.0 API methods, the program crashes with a segmentation fault. The crash happens specifically during the
cv2.aruco.detectMarkers()
call.Steps to Reproduce
cv2.aruco.getPredefinedDictionary()
andcv2.aruco.DetectorParameters()
cv2.aruco.detectMarkers()
with the created dictionary and parametersCrash Information
When run with strace, the program shows the following crash pattern:
Workaround
The issue can be resolved by using the older ArUco API functions:
cv2.aruco.Dictionary_get()
instead ofcv2.aruco.getPredefinedDictionary()
cv2.aruco.DetectorParameters_create()
instead ofcv2.aruco.DetectorParameters()
Code Sample to Reproduce
The text was updated successfully, but these errors were encountered: