-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
可否支持多摄像头 #47
Comments
最简单的,为每一个摄像头创建线程,然后每一个摄像头线程内创建一个只有1线程的模型线程池就好了
此方法会造成资源的一些浪费,您可以调高cv::waitKey()的值,或者自行添加sleep到循环内,确保某一个摄像头帧率不会过高 |
或者您可以自定义输入输出如下,然后在主线程中创建一个模型线程池,每一个摄像头线程调用put方法进行输入,再参考单生产者,多消费者的模式获取对应摄像头的输出
|
我想问下这个问题,我按这个实现出现两个问题,一个是之前线程数可以设置得高一些,现在只能设置成1,大于1就core dumped;另一个是画面显示的框都聚集在左上方的一个矩形区域内,不正常。请问是什么原因呢?该如何解决,期待大佬解答 |
不太清楚诶,实在不行您要不参考 rknnPool 类,直接获取线程池返回的 future 句柄,在摄像头线程内部对输入输出序列进行单独维护吧。想了想 rknnPool 类内部对线程池和 std::queue<std::future> futs 队列进行维护有点过于耦合了() |
想采用多摄像头并行检测,但水平实在是有限
The text was updated successfully, but these errors were encountered: