4. Use OPenCV in the QT environment (video or camera reading is displayed on the QLabel control)

1. Description

When processing images with opencv, the source of the image is read from the video in most cases. The video can be a locally saved video, or a real-time video captured by a local camera or a network camera.
Show results:

opencv read video

2. Concrete operation

Regarding the reading of the video, in fact, each frame of image is loaded from the video and displayed on the QLabel control. The reading of each frame is controlled by a timer, that is, it is read frame by frame within the interval time. Fetching image frames, if you don't use a timer for the operation, there may be problems.
UI interface design:
insert image description here

2.1 Read local video files

widget.h:

#ifndef WIDGET_H

Guess you like

Origin blog.csdn.net/FY_13781298928/article/details/131326244