You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
-20Lines changed: 0 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,14 +7,10 @@
7
7
8
8
Real‑time multithreaded webcam/video capture in modern C++20 & OpenCV that keeps your main thread free for computer vision or ML inference.
9
9
10
-
---
11
-
12
10
## Why?
13
11
14
12
OpenCV's `VideoCapture` is synchronous: every `read()` blocks on USB/RTSP I/O and decoding. This library adds a **producer/consumer** queue so frame acquisition runs on a dedicated thread, lifting throughput up to **32%** on a 4‑core laptop while keeping latency bounded.
15
13
16
-
---
17
-
18
14
## Features
19
15
20
16
| Category | What you get |
@@ -25,8 +21,6 @@ OpenCV's `VideoCapture` is synchronous: every `read()` blocks on USB/RTSP I/O an
25
21
| Metrics | Built‑in FPS / latency stats returned as a C++ struct or JSON. |
The `detach` method (`t1.detach()`) is used so we don't need to wait for thread 1 to finish. Instead, it will get the dataframe. The process happens simultaneously.
74
64
75
-
---
76
-
77
65
## Measuring FPS and Elapsed Time
78
66
79
67
I first used the **chrono** library to measure the time but found that it's hard to convert to seconds for calculating FPS. So, I use **ctime**:
The elapsed time doesn't change much; however, the FPS of streaming 100 and 1000 frames increases by 23.5% and 31.5%, respectively.
132
116
133
-
---
134
-
135
117
## License
136
118
137
119
This project is licensed under the MIT License — see [LICENSE](LICENSE) for details.
138
120
139
-
---
140
-
141
121
## Acknowledgements
142
122
143
123
- Inspired by [PyImageSearch: "How to increase FPS with multithreading in OpenCV"](https://www.pyimagesearch.com/2015/12/21/increasing-webcam-fps-with-python-and-opencv/)
0 commit comments