Ask Your Question
0

Incorporating CUDA API in prebuilt compiled Opencv ecc.cpp code

asked 2018-07-06 04:07:54 -0600

Vidhu gravatar image

Hi, To improve the performance of image registration using findtransformecc() Opencv API ,I changed warpperspective() to cuda::warpperspective() in ecc.cpp file. But I'm stuck with the following error.

undefined reference to `cv::cuda::warpPerspective(cv::_InputArray const&, cv::_OutputArray const&, cv::_InputArray const&, cv::Size_<int>, int, int, cv::Scalar_<double>, cv::cuda::Stream&)' collect2: error: ld returned 1 exit status.

edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted
0

answered 2018-07-06 04:18:51 -0600

berak gravatar image

in prebuilt compiled Opencv

no , not possible. you have to add cuda support when building the opencv libs

(install a cuda sdk, then build the opencv library, using cmake)

edit flag offensive delete link more

Comments

I'm using NVIDIA Jetson TX1 with cuda version 8. A sample code with cuda::warpPerspective() alone works properly. But when I incorporate cuda::warpperspective() inside ecc.cpp and enter "make -j7" from /opencv-3.3.1/build/, errors occurs.

Vidhu gravatar imageVidhu ( 2018-07-06 04:53:21 -0600 )edit

oh, you're trying to modify the opencv library code ? you have to rebuild the opencv libs then. also you have to add the resp. cuda dependancy lib to the CmakeLists.txt for the lib, ecc.cpp is in (no idea, which it is)

berak gravatar imageberak ( 2018-07-06 05:01:41 -0600 )edit

undefined reference error is now gone by executing cmake once again. Now following errors occurs. error: ‘threadIdx’ was not declared in this scope const uint tid = (threadIdx.z * blockDim.y + threadIdx.y) * blockDim.x + threadIdx.x; error: ‘blockDim’ was not declared in this scope const uint tid = (threadIdx.z * blockDim.y + threadIdx.y) * blockDim.x + threadIdx.x;

Vidhu gravatar imageVidhu ( 2018-07-06 06:52:18 -0600 )edit

sorry, but we can't solve anything without context

berak gravatar imageberak ( 2018-07-07 05:43:07 -0600 )edit

Question Tools

Stats

Asked: 2018-07-06 04:07:54 -0600

Seen: 682 times

Last updated: Jul 06 '18