将图片格式转一转
nRGBSize = frame_info.nWidth * frame_info.nHeight
convert_param = MV_CC_PIXEL_CONVERT_PARAM()
memset(byref(convert_param), 0, sizeof(convert_param))
convert_param.nWidth = frame_info.nWidth
convert_param.nHeight = frame_info.nHeight
convert_param.pSrcData = image_data_size
convert_param.nSrcDataLen = frame_info.nFrameLen
convert_param.enSrcPixelType = frame_info.enPixelType
convert_param.enDstPixelType = frame_info.enPixelType
convert_param.pDstBuffer = (c_ubyte * nRGBSize)()
convert_param.nDstBufferSize = nRGBSize
ret = cam.MV_CC_ConvertPixelType(convert_param)
img_buff = (c_ubyte * convert_param.nDstLen)()
cdll.msvcrt.memcpy(byref(img_buff), convert_param.pDstBuffer, convert_param.nDstLen)
img = np.array(img_buff, dtype=np.int8)
Img = img.reshape(1024, 1280)
Img = cv.flip(Img, -1)
Img = cv.flip(Img, -1)