从相机取景时使用螺纹 [英] using threads when taking frames from the camera

查看:77
本文介绍了从相机取景时使用螺纹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我有一台相机并在框架上进行了一些处理.但是我必须使该处理更快.
因此,我试图创建一个缓冲区,当我使用新框架时,一个线程将在旧框架上执行该过程,如何使用线程来做到这一点?我尝试了CriticalSection函数,但遇到运行时错误.尝试了waitForSingleObject函数,但无法获得更高的速度.必须使用什么?

Hi
I have a camera and making some process on frames.But I must make this process faster.
Because of that I''m trying to create a buffer.When I''m taking the new frame a thread will do the process on the old frame.How can I do that using threads? I tried CriticalSection functions but I''ve got run time errors.And I tried waitForSingleObject functions but I couldn''t get more speed.What must I use ?

推荐答案

使用线程,仅在多核系统上可能会提高性能.
无论如何,多线程编程是一个非常复杂的主题,您应该知道自己在做什么才能获得收益(同步功能的问题,让我认为您需要对此问题有更深入的了解).
With threads you may have a performance gain just on multicore systems.
In any case mutithreaded programming is a quite complex topic and you should know what are you doing in order to get benefits (your issues with synchronization functions, make me think you need a deeper understanding of the matter).


这篇关于从相机取景时使用螺纹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆