I'm trying to create an image using opencv v 2.1, but I get this error:
image=cv.CreateImage((w,h),no_of_bits,channels)
AttributeError: 'module' object has no attribute 'CreateImage'
The code is
#!/usr/bin/python
import cv
from opencv import *
from opencv.cv import *
from opencv.highgui import *
import sys
import PIL
w=500
h=500
no_of_bits=8
channels=3
image=cv.CreateImage((w,h),no_of_bits,channels)
cv.ShowImage('WindowName',image)
cvWaitKey()
Best Solution
Since there aren't that many good examples how to create new blank image filled with a color using cv2, here's one:
Create OpenCV image of certain (R, G, B) color: