source = cv2.imread()
bitmap = cv.CreateImageHeader((source.shape[1], source.shape[0]), cv.
    IPL_DEPTH_8U, 3)
cv.SetData(bitmap, source.tostring(), source.dtype.itemsize * 3 * source.
    shape[1])
OpenCV: Converting from NumPy to IplImage in Python