【发布时间】:2015-05-13 06:19:00
【问题描述】:
我尝试将 ndarray 转换为图像:
import numpy as np
import cv2
def main():
#...
data_array = []
data_array.append((255, 255, 255))
data_array.append((255, 255, 255))
# http://pastebin.com/iUs6ebBU
new_image = np.array(data_array).reshape((height, width, 3))
r,g,b = cv2.split(new_image)
img_bgr = cv2.merge([b,g,r])
cv2.imshow('image',img_bgr)
cv2.waitKey(0)
但我只看到黑色图像,而不是我的。有什么问题?
【问题讨论】:
标签: python image python-2.7 opencv numpy