python cv2 mat numpy


cv2 mat   numpy

# Helper code
def load_image_into_numpy_array(image_param):
  img_shape = image_param.shape
  im_width = img_shape[1]
  im_height = img_shape[0]

  image_param1 = Image.fromarray(image_param.astype('uint8')).convert('RGB')
  #(im_width, im_height) = image_param.size
  #im_width = 640
  #im_height = 480
  return np.array(image_param1.getdata()).reshape(
      (im_height, im_width, 3)).astype(np.uint8)

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM