def hist(img):
[m,n]=img.shape
out=[]
a = 0
for i in range(m):
temp=0
for j in range(n):
temp=temp+img[i,j]
out.append(temp)
for i in range(m):
if out[i]!=0:
a=a+1
return a
img = cv2.imread("")
求将上述代码编为pyqt中的槽函数,并且最后点击pushbutton能够输出的a在可视化窗口中输出显示出来。谢谢