[Python] 纯文本查看 复制代码from ctypes import *
import ctypes
import cv2
import numpy as np
dll = cdll.LoadLibrary("./AlgorithmDll.dll")
GetDispImgByMatch = dll.GetDispImgByMatch
GetDispImgByMatch.argtypes = [
ctypes.POINTER(ctypes.c_ubyte),
ctypes.POINTER(ctypes.c_ubyte),
ctypes.POINTER(ctypes.c_ubyte),
ctypes.c_int,
ctypes.c_int]
GetDispImgByMatch.restype = None
SmoothDispImage = dll.SmoothDispImage
SmoothDispImage.argtypes = [
ctypes.POINTER(ctypes.c_ubyte),
ctypes.c_int,
ctypes.c_int]
SmoothDispImage.restype = None
#
width = ctypes.c_int(640)
height = ctypes.c_int(480)
img1 = cv2.imread('./Clibration/Calibration.bmp')
img_data = np.asarray(img1).ctypes.data_as(ctypes.POINTER(ctypes.c_ubyte))
img2 = cv2.imread('./Capture_images/20200111/19363834336.bmp')
img_data2 = np.asarray(img2).ctypes.data_as(ctypes.POINTER(ctypes.c_ubyte))
img3 = cv2.imread('./Capture_images/20200111/193617020263.bmp')
Dispaly_img = np.asarray(img3).ctypes.data_as(ctypes.POINTER(ctypes.c_ubyte))
GetDispImgByMatch(img_data, img_data2, Dispaly_img, width, height)
SmoothDispImage(Dispaly_img,width, height)