“module”对象没有属性“NORM\u L1”

2024-04-18 19:07:07 发布

您现在位置:Python中文网/ 问答频道 /正文

我编写了下面的代码来使用Python和OpenCV规范化图像。当我试图编译下面的代码时,我得到了下面的错误。你能帮我解决这个问题吗?你知道吗

`import cv2.cv as cv`
` import numpy`
  import normalize

img=cv.LoadImage("img.jpg",0)
mat=cv.GetMat(img)
a = numpy.asarray(mat)   #store the pixels in the input array

dst=[]      # declare the output array

cv.Normalize(a,dst,0,255,cv.NORM_L1)
print a

Tags: the代码图像importnumpyimgas错误