Ask Your Question
0

cv::cuda::meanStdDev for CV_32FC1

asked 2016-11-10 13:12:55 -0600

mescarra gravatar image

Hello everyone!

I was wondering whether cv::cuda::meanStdDev function will be implemented for the CV_32FC1 type in the near future or if it's not in the priority list at all.

I know I can download the image and use the host function (that's exactly my workaround now) but this is very slow and involves a download operation. I'm barely achieiving real-time.

Thanks a lot.

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
3

answered 2016-11-10 18:05:45 -0600

Tetragramm gravatar image

If you are willing to re-compile, it's not that hard to add it. The npp function is there, you just need to add it to the table. And a couple of if statements.

https://github.com/opencv/opencv/blob...

edit flag offensive delete link more

Comments

Wait, line 142 asserts matrix type should be CV_8UC1. And nppiMeanStdDev8uC1RGetBufferHostSize or nppiMeanStdDevGetBufferHostSize_8u_C1R, don't really know what they do, but they both seem to be specific to the CV_8UC1 type.

mescarra gravatar imagemescarra ( 2016-11-11 19:13:11 -0600 )edit
1

Yep, you need to change some lines, add an if statement or two. The 32F_C1R functions exist, you just need to tell it to use them.

Tetragramm gravatar imageTetragramm ( 2016-11-12 00:06:59 -0600 )edit

@Tetragramm, I've searched for nppiMeanStdDev32FC1RGetBufferHostSize in "https://developer.download.nvidia.com...", but I couldn't find a solution. How can I use 32FC1 then?

Vidhu gravatar imageVidhu ( 2018-08-02 02:11:54 -0600 )edit
0

answered 2018-08-03 02:09:33 -0600

Vidhu gravatar image

Hi, The same operation of cuda::meanStdDev() on CV_32FC1 can be implemented through the combination of cuda::sum(), cuda::subtract(), cuda::sqrSum().

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2016-11-10 13:12:55 -0600

Seen: 1,255 times

Last updated: Aug 03 '18