i want to create a multichannel mat object in python with cv2 opencv wrapper.
i've found examples on the net where the c++ Mat::zeros is replaced with numpy.zeros, that seems good. but no multichannel type seems to fit..
look at the code:
import cv2
import numpy as np
size = 200, 200
m = np.zeros(size, dtype=np.uint8) # ?
m = cv2.cvtColor(m, cv2.COLOR_GRAY2BGR)
p1 = (0,0)
p2 = (200, 200)
cv2.line(m, p1, p2, (0, 0, 255), 10)
cv2.namedWindow("draw", cv2.CV_WINDOW_AUTOSIZE)
while True:
cv2.imshow("draw", m)
ch = 0xFF & cv2.waitKey(1)
if ch == 27:
break
cv2.destroyAllWindows()
i want to avoid m = cv2.cvtColor(m, cv2.COLOR_GRAY2BGR)
but neither cv2.CV_8UC3
np.uin32
works.
some hint?