I would like to resolve the errors in the executable file in opencv and GPU without using cmake.

Asked 1 years ago, Updated 1 years ago, 63 views

Here's the source code.

#include<opencv2/opencv.hpp>// Include file specification
// # include <opencv2/opencv_lib.hpp>// Specify Static Link Library

# include <opencv2/gpu/gpu.hpp>

# pragma comment (lib, "opencv_core2413d.lib")
# pragma comment (lib, "opencv_imgproc2413d.lib")
# pragma comment (lib, "opencv_highgui2413d.lib")

# pragma comment (lib, "opencv_gpu2413d.lib")

using namespace cv;// Specifying Namespace

int main() {
    cv::Mat src_img=cv::imread("C:\\Users\\Daito\\Desktop\\DTWW6svVQAEvgvk.jpg", CV_LOAD_IMAGE_GRAYSCALE);
    if(src_img.empty()) return-1;

    gpu::GpuMat gpuSrc(src_img);
    gpu::GpuMat gpuDst;
    gpu:: Laplacian(gpuSrc, gpuDst, 0);
    cv::Mat dst(gpuDst);

    cv::imshow("C:\\Users\\Daito\\Desktop\\DTWW6svVQAEvgvk.jpg", src_img);
    cv::imshow("C:\\Users\\Daito\\Desktop\\DTW6svVQAEvgvk.jpg", dst);

    waitKey(0);

    return 0;
}

Here is the error code.

OpenCV Error: No GPU support (The library is compiled without CUDA support) in EmptyFuncTable::mallocPitch, file C:\builds\2_4_PackSlave-win64-vc12-shared\opencv\modules\dynamicuda\include\dynamicudine\dynamicuda\dynamicuda\dynamic\dynamicaudic\damuda, 126

I wanted to solve this problem without using Cmake as part of my study, and I asked this question because I wanted to do it manually.

The following is a multi-post.
https://detail.chiebukuro.yahoo.co.jp/qa/question_detail/q12188355392
https://oshiete.goo.ne.jp/qa/10399808.html

c++ opencv cuda

2022-09-30 19:51

1 Answers

The officially distributed binaries do not support GPUs are not supported.If you want to support CUDA, you have to build it yourself.

I think the following site will be helpful.

https://jamesbowley.co.uk/build-compile-opencv-3-4-in-windows-with-cuda-9-0-and-intel-mkl-tbb/


2022-09-30 19:51

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.