【发布时间】:2012-03-31 10:01:00
【问题描述】:
我正在尝试使用 opencv v 2.1 创建图像,但出现此错误:
image=cv.CreateImage((w,h),no_of_bits,channels)
AttributeError: 'module' 对象没有属性 'CreateImage'
代码是
#!/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()
【问题讨论】: