Using OpenCV 3.4 and converting to use GPU (CUDA)

asked 2020-03-25 10:34:09 -0500

AaronB gravatar image

I am relative new to OpenCV so, i still learning.

This is the original code...

std::vector<cv::Point> Benchmark::FindNonZeroPixels(const cv::Mat *inputImage, int nonZeroPixelCt)
{
    if (nonZeroPixelCt > 0)
    {
        cv::findNonZero(*inputImage, nonZeroCoordinates);
    }

    return nonZeroCoordinates;
}

There is no CUDA equivalent of findNonZero;

That I wanted is something like this...

std::vector<cv::Point> Benchmark::FindNonZeroPixels(const cv::cuda::GpuMat *inputImage, int nonZeroPixelCt)
{
    if (nonZeroPixelCt > 0)
    {
        cv::cuda::findNonZero(*inputImage, nonZeroCoordinates); // There seems to be no equivalent.
    }

    return nonZeroCoordinates;
}

What is the CUDA equivalent to the opencv findNonZero? cv:cuda::findMinMaxLoc does not return a vector of points like cv::findNonZero other suggestions would be appreciated.

Thanks in advance. I am working at home while learning in these weird times.

edit retag flag offensive close merge delete