Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/image/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 属性错误:模块';PIL.ImageQt';没有属性';图像qt';_Python_Image_Pyqt4_Python 3.7_Opencv Python - Fatal编程技术网

Python 属性错误:模块';PIL.ImageQt';没有属性';图像qt';

Python 属性错误:模块';PIL.ImageQt';没有属性';图像qt';,python,image,pyqt4,python-3.7,opencv-python,Python,Image,Pyqt4,Python 3.7,Opencv Python,imageQt没有属性,这是一个错误。我尝试过从PIL.ImageQt导入ImageQt更改,但它给出了ImportError:无法从'PIL.ImageQt'导入名称'ImageQt'。看起来您确实在处理导入。在细节上似乎 import sys import pickle as p from PyQt4 import QtCore, QtGui, uic import numpy as n import PIL.ImageQt as PQ from PIL import Image impor

imageQt没有属性,这是一个错误。我尝试过从PIL.ImageQt导入ImageQt更改
,但它给出了
ImportError:无法从'PIL.ImageQt'导入名称'ImageQt'。
看起来您确实在处理导入。在细节上似乎

import sys
import pickle as p
from PyQt4 import QtCore, QtGui, uic
import numpy as n
import PIL.ImageQt as PQ
from PIL import Image
import cv2
import os

self.currentFrame=cv2.cvtColor(frame,cv2.COLOR_BGR2RGB)
self.currentSeg=Image.fromarray(thresh).convert('RGB')
self.currentSeg = PQ.ImageQt(self.currentSeg)
height,width=self.currentFrame.shape[:2]
与……冲突

import PIL.ImageQt as PQ
如果
ImageQt
是您想要访问的对象,那么我建议按如下方式更改行:

self.currentSeg = PQ.ImageQt(self.currentSeg)
import PIL.ImageQt as PQ
self.currentSeg = PQ(self.currentSeg)