How to use cv::Mat with NPP

Hi all,

I am currently programming a computer vision program using openCV and cuda. To accelerate the speed of the watershed algorithm I want to use the NPP library. The only problem is that I can’t seem to get the cv::Mat (or GpuMat) to work with NPP.

I tried copying the data from the Mat to Npp8u (which is REALLY slow). Also tried to create a Npp8u pointer of the Mat, this just would not work.
Also in all the examples of NPP i found that they only use .raw images that are stored on the HDD/SSD.

So I have a few questions:

  • Can I use anything other than .raw images?
  • Must the image be stored on the HDD/SSD? (so no live camera feed)?
  • Can I transform my RGB cv::Mat to be usable with NPP functions?

some info:

  • OpenCV version 4.5.3
  • Cuda version 11.6
  • OS: Ubuntu 20.04

I hope somebody knows the answer to all, or one of, my questions.

Okay, call it typical. After searching the whole day I find nothing.
But when I ask this question here, and continue searching, I find it almost immediately…

For anybody with the same question, look at the following link, it explains how to use Mat and GpuMat with NPP.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.