Home > other >  Pyqt how can display properly opencv video format
Pyqt how can display properly opencv video format

Time:11-25

I now made an interface, and then want to show a video camera, I found the opencv pop-up window video to real-time display normally, but the video in the pyqt can't normal real-time display, with bosses know how to solve?


My code is as follows:
Img1=yolo. Detect_image (self. Frame)

Img=CV. Resize (img1 (1280, 720), interpolation=CV. INTER_AREA)
Height, width, bytesPerComponent=img. Shape # color images of long, wide, channel
BytesPerLine=3 * width
CV. CvtColor (img, CV. COLOR_BGR2RGB, img)
QImg=QImage (img) data, width, height, bytesPerLine, QImage. Format_RGB888)

Pixmap=QPixmap. FromImage (QImg)
Self. Label_ShowPicture. SetPixmap (QPixmap (pixmap))
  • Related