मैं OpenCV मास्टर शाखा (3.0.0 देव।) का उपयोग कर रहा CUDA के साथ Ubuntu 12.04 पर, और GPU कोड के साथ निम्नलिखित opencv संकलित करने के लिए कोशिश कर रहा है:संकलन त्रुटि सीवी :: GPU
#include <iostream>
#include "opencv2/opencv.hpp"
#include "opencv2/core.hpp"
#include "opencv2/highgui.hpp"
#include "opencv2/gpu/gpu.hpp"
using namespace cv;
int main (int argc, char* argv[])
{
try
{
cv::Mat src_host = cv::imread("file.png", CV_LOAD_IMAGE_GRAYSCALE);
cv::gpu::GpuMat dst, src;
src.upload(src_host);
cv::gpu::threshold(src, dst, 128.0, 255.0, CV_THRESH_BINARY);
cv::Mat result_host = dst;
cv::imshow("Result", result_host);
cv::waitKey();
}
catch(const cv::Exception& ex)
{
std::cout << "Error: " << ex.what() << std::endl;
}
return 0;
}
संकलन आदेश है:
g++ testgpu.cpp -o test `pkg-config --cflags --libs opencv` -lopencv_gpu
यह निम्न संकलन त्रुटियां हैं:
testgpu.cpp: In function ‘int main(int, char**)’:
testgpu.cpp:13:51: error: ‘CV_LOAD_IMAGE_GRAYSCALE’ was not declared in this scope
cv::Mat src_host = cv::imread("file.png", CV_LOAD_IMAGE_GRAYSCALE);
^
testgpu.cpp:17:52: error: ‘CV_THRESH_BINARY’ was not declared in this scope
cv::gpu::threshold(src, dst, 128.0, 255.0, CV_THRESH_BINARY);
^
testgpu.cpp:19:31: error: conversion from ‘cv::gpu::GpuMat’ to non-scalar type ‘cv::Mat’ requested
cv::Mat result_host = dst;
^
यह कुछ OpenC की स्थापना के साथ कुछ गड़बड़ है वी, या ओपनसीवी 3.0.0 में एपीआई परिवर्तन?
संभव डुप्लिकेट (http://stackoverflow.com/questions/14468191/error-with-gpumat-and-mat) – talonmies