2017-04-27 3 views
0

IAttribute: 'Modul' Objekt hat kein Attribut 'Popall'

python tes4.py 

dieser Befehl ausgeführt wird und es verursacht diesen Fehler:

AttributeError: 'module' object has no attribute 'popall' 

Mein Programm wie dieses

import cv2 
import numpy as np 
from matplotlib import pyplot as plt 

gray_img = cv2.imread('lena.jpg', cv2.IMREAD_GRAYSCALE) 
cv2.imshow('GoldenGate',gray_img) 
#hist = cv2.calcHist([gray_img],[0],None,[256],[0,256]) 
hist,bins = np.histogram(gray_img,256,[0,256]) 

plt.hist(gray_img.ravel(),256,[0,256]) 
plt.title('Histogram for gray scale picture') 
plt.show() 

while True: 
    k = cv2.waitKey(0) & 0xFF  
    if k == 27: break    # ESC key to exit 
cv2.destroyAllWindows() 

Was soll ich machen??

Antwort

Verwandte Themen