Ask Your Question

LuisBrocan's profile - activity

2015-10-22 06:20:46 -0600 received badge  Student (source)
2015-10-22 03:09:08 -0600 asked a question CUDA HaarCascade stream assertion

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!