Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

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!