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