Suppose I am taking an image from the webcam using opencv.
_, img = self.cap.read() # numpy.ndarray (480, 640, 3)
Then I create a QImage
qimg using img
:
qimg = QImage(
data=img,
width=img.shape[1],
height=img.shape[0],
bytesPerLine=img.strides[0],
format=QImage.Format_Indexed8)
But it gives an error saying that:
TypeError: 'data' is an unknown keyword argument
But said in this documentation, the constructor should have an argument named data
.
I am using anaconda environment to run this project.
opencv version = 3.1.4
pyqt version = 5.9.2
numpy version = 1.15.0