CUDA HaarCascade stream assertion

asked 2015-10-22 03:06:24 -0600

LuisBrocan gravatar image

Hi,

HaarCascade detectMultiScale function accepts a cuda::Stream, and the code seems to use it. But there is an assertion that expects a null stream.

CV_Assert( !stream );

Is the use of streams in cuda haar cascade not supported yet? or its a bug?

 void HaarCascade_Impl::detectMultiScale(InputArray _image,
                                            OutputArray _objects,
                                            Stream& stream)
    {
        const GpuMat image = _image.getGpuMat();

        CV_Assert( image.depth() == CV_8U);
        CV_Assert( scaleFactor_ > 1 );
        CV_Assert( !stream );
    Size ncvMinSize = getClassifierSize();
    if (ncvMinSize.width < minObjectSize_.width && ncvMinSize.height < minObjectSize_.height)
    {
        ncvMinSize.width = minObjectSize_.width;
        ncvMinSize.height = minObjectSize_.height;
    }

    BufferPool pool(stream);
    GpuMat objectsBuf = pool.getBuffer(1, maxNumObjects_, DataType<Rect>::type);

    unsigned int numDetections;
    ncvSafeCall( process(image, objectsBuf, ncvMinSize, numDetections) );

    if (numDetections > 0)
    {
        objectsBuf.colRange(0, numDetections).copyTo(_objects);
    }
    else
    {
        _objects.release();
    }
}

Thanks in advance!

edit retag flag offensive close merge delete

Comments

I have the same problem in cv::cuda::HOG::compute. I suspect that the multi-stream functionality is still not supported by openCV libraries.

Gabriele D gravatar imageGabriele D ( 2015-11-17 10:39:59 -0600 )edit