Linker issue - OpenCV Cuda Canny filter

Good morning everyone

I’ve been trying to implement the houghTransform algorithm from scratch Using Cuda and seems i’ve succeeded. Now, my goal is to compare the performance of my HoughTransform Kernel with the one implemented on OpenCV::Cuda.

I started by performing a simple cv::cuda::Canny filter before calling cv::cuda::HoughlinesP but seems like i have some linker problems …

Here are my includes

// Includes

#include "cuda.h"
#include "cuda_runtime.h"
#include "device_launch_parameters.h"

#include <opencv2/cudaimgproc.hpp>
#include <opencv2/core/core.hpp>
#include <opencv2/core/cuda.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/imgcodecs.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/opencv.hpp>

#include <stdio.h>

Here is my function:

void applyCannyDevice(){
        Mat mat = imread("./Sudoku.jpg");

	Ptr<cuda::CannyEdgeDetector> canny = cuda::createCannyEdgeDetector(50, 100);
	cv::cuda::GpuMat edge;
	cv::cuda::GpuMat src(mat);
	canny->detect(src, edge);

	double t1 = getTickCount();
	for (int i = 0; i<10; i++)
	{
		canny->detect(src, edge);
	}
	double t2 = getTickCount();
	cout << "cuda time:" << (t2 - t1) / getTickFrequency() / 10 << endl; 
}

And i’m having this error problem:

  1. Erreur LNK2001 symbole externe non résolu “struct cv::Ptr __cdecl cv::cuda::createCannyEdgeDetector(double,double,int,bool)” (?createCannyEdgeDetector@cuda@cv@@YA?AU?$Ptr@VCannyEdgeDetector@cuda@cv@@@2@NNH_N@Z)

Is there any additional Path/Library i need to add?

Linker input:
Additional dependencies:

opencv_imgcodecs420.lib
opencv_highgui420.lib
opencv_imgproc420.lib
opencv_core420.lib
cudart_static.lib …

I would appreciate any kind of help !

Thanks in advance.

Problem solved by adding the following .lib to the input linker …

opencv_cudaarithm420.lib
opencv_cudafilters420.lib
opencv_cudaimgproc420.lib
opencv_cudacodec420.lib