python ctypes point to void* error

0

I already load dll, and when I use it, There is something wrong

and the C function is:

#define CV_DETECT_ENABLE_ALIGN_106 0x0000020

typedef void *cv_handle_t;

CV_SDK_API 
cv_result_t
cv_face_create_detector(
    cv_handle_t *handle,
    const char *modle_path,
    unsigned int config
);

In python:

CV_DETECT_ENABLE_ALIGN_106 = 0x00000020

cv_face_create_detector = dll.cv_face_create_detector
cv_face_create_detector.restype = c_int
cv_face_create_detector.argtypes = (POINTER(c_void_p), c_char_p, c_uint)

a = c_void_p(0)
handle_detect = byref(a)

result = cv_face_create_detector(handle_detect, None, CV_DETECT_ENABLE_ALIGN_106)
print(result)

The error:

result = cv_face_create_detector(handle_detect, None, CV_DETECT_ENABLE_ALIGN_106)

OSError: [WinError -529697949] Windows Error 0xe06d7363

Thanks a lot

python
ctypes
asked on Stack Overflow Jun 30, 2017 by solideo • edited Jun 30, 2017 by solideo

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0