Home > other >  TypeError: fromBGR2QImage () missing 1 required positional argument: 'frame'
TypeError: fromBGR2QImage () missing 1 required positional argument: 'frame'

Time:09-23

 
# Image. Py
Def fromBGR2QImage (self, frame) :
Height, width, bytesPerComponent=frame shape
BytesPerLine bytesPerComponent * width=
# change color space order
Temp=frame
Temp=cv2. CvtColor (temp, cv2 COLOR_BGR2RGB)
# to QImage object
Image=QtGui. QImage (temp) data, width, height, bytesPerLine, QtGui. QImage. Format_RGB888)
Return the image


# Main. Py
The from Image import fromBGR2QImage
The class the Main () :
Def __init__ (self, parnet=None) :
The self, super (Main) __init__ ()
The self. The cap=cv2. VideoCapture (0)
Self. UpdateFrame ()

Def updateFrame (self) :
Ret, frame=self. Cap. The read ()
Image=fromBGR2QImage (self, frame) error # # where



Error:
Traceback (the most recent call last) :
The File "demo2. Py", line 36, in updateFrame
Image=fromBGR2QImage (frame)
TypeError: fromBGR2QImage () missing 1 required positional argument: 'frame'

CodePudding user response:

Is there a big help to have a look at what is reason

CodePudding user response:

Top
Prev:FORTRAN
Next:FRFT
  • Related