Ask Your Question
0

How to use cuda::cvtColor?

asked 2018-02-01 16:30:04 -0600

mike_perreman gravatar image

updated 2018-02-01 18:27:28 -0600

Hello, for testing purposes, I want to capture an image from a webcam, upload it to the gpu, cuda::cvtColor, cuda::threshold, and then display it. I have the capture working fine, im stuck at cuda::cvtColor. my includes are this:

#include "opencv2/core.hpp"
#include "opencv2/opencv.hpp"
#include "opencv2/highgui.hpp"
#include "opencv2/videoio.hpp"
#include "opencv2/core/cuda.hpp"
#include "opencv2/cudaimgproc.hpp"

#include <iostream>

and here is the code that is giving me trouble:

cuda::cvtColor(gpuMat, grayGpuMat, cuda::COLOR_RGB2GRAY);

The error is this:

error: ‘COLOR_RGB2GRAY’ is not a member of ‘cv::cuda’
     cuda::cvtColor(gpuMat, grayGpuMat, cuda::COLOR_RGB2GRAY);

it suggests to use cv::COLOR_RGB2GRAY.

So, what am I doing wrong.

UPDATE: I now have determined that I cannot link properly, error being:

/usr/bin/ld: cannot find -lopencv_cudaimgproc
edit retag flag offensive close merge delete

Comments

"it suggests to use cv::COLOR_RGB2GRAY." -- yes, that is correct. the flags are all the same for cpu/gpu

"cannot find -lopencv_cudaimgproc" -- are you sure, the cuda related modules were built properly ? can we see the cmake output ?

berak gravatar imageberak ( 2018-02-02 02:24:42 -0600 )edit

1 answer

Sort by » oldest newest most voted
0

answered 2018-02-03 12:09:28 -0600

mike_perreman gravatar image

I found the issue, there was multiple versions of opencv installed, causing my weird errors

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2018-02-01 16:30:04 -0600

Seen: 10,486 times

Last updated: Feb 01 '18