import ctypes import math import os try: libpr = ctypes.cdll.LoadLibrary('./libpr.so') except Exception as e: print(str(e)) # 设定 libpr 的参数类型和返回值类型 libpr.wrap_for_python_plate_recognize.restype = ctypes.c_char_p libpr.wrap_for_python_plate_recognize.argtypes = [ctypes.c_char_p, ctypes.c_char_p, ctypes.c_char_p, ctypes.c_int] func_plate_recognize = libpr.wrap_for_python_plate_recognize if __name__ == '__main__': file_path = b"./test.jpg" result = func_plate_recognize(file_path, b'', b'', 0) print(result.decode("UTF-8"))