简体   繁体   中英

Can I use gpu::Stream for CascadeClassifier_GPU on OpenCV and how?

I use Opencv 2.4.10 (current stable version). And I use gpu::CascadeClassifier_GPU::detectMultiScale to detection faces. I want to use it async with my CUDA-kernel-code which I launch in separate cudaStream_t . But by default CascadeClassifier_GPU launch in the default zero-stream that make impossible to launch anything async to this on GPU.

As I see here no way to use gpu::Stream for CascadeClassifier_GPU : OpenCV DOC link

  • Can I use gpu::Stream for CascadeClassifier_GPU and how?
  • If no, then in what version of OpenCV can I do it?

UPDATE : So far the only way I've found - use a separate CPU thread to perform the function of the gpu::CascadeClassifier_GPU::detectMultiScale and perform it on a separate GPU. But for this at least I need 2 GPUs.

CascadeClassifier_GPU uses mixed GPU/CPU implementation and performs extra synchronizations internally, that's why it doesn't support asynchronous mode with gpu::Stream parameter. In order to launch it asynchronously with your code, you need to use separate CPU thread for it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM