-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Description
Describe the feature and motivation
Overview
Introduce a new cv2::stream
API to support real-time streaming of image or video data from any source—such as cameras, capture boards, 3D sensors, and custom pipelines—directly within OpenCV. This allows live preview of processed or raw frames in various development and production environments, especially when data is not readily available or highly variable.
Motivation
OpenCV is often used to process static image or video files. However, it is also increasingly being used as part of a pipeline to process live feed, such as from cameras or screens. A native streaming feature in OpenCV would have many applications in such context, especially in robotics, reinforcement learning (RL), and experimental or iterative computer vision pipelines. It enables real-time feedback and visualization for development, debugging, and demonstration purposes, which is currently extremely cumbersome without resorting to external servers or manual solutions.
Proposed Implementation
The feature would support streaming over web protocols. When used in remote development setups (e.g., via SSH with Jupyter Notebook), the stream object could output an HTML embed to display the live feed directly in the notebook output cell, rather than just static images(which is often done so when using opencv in conjunction with matplotlib). Integration with web UIs would also be possible.
The implementation would avoid introducing additional heavy dependencies or frameworks, instead leveraging either well-defined modules in OpenCV or existing packages that are already available in many distributions.
Basic token authentication may also be included if it is recommended to do so.
Additional Context
If the maintainers are open to such an implementation, me and my team will start working on this feature immediately.