cv::Mat image = cv::imread(imageName, CV_LOAD_IMAGE_COLOR);
cv::gpu::GpuMat gpu_image(image);
cv::imshow("image", image);
altro modo (http://stackoverflow.com/questions/9318388/opencv-gpumat-usage)
Mat src;
src = cv::imread("...");
GpuMat dst;
dst.upload(&src);
secondo approccio (http://stackoverflow.com/questions/6965465/how-to-convert-gpumat-to-cvmat-in-opencv)
explicit conversion: Mat -> GPUMat
Mat myMat;GpuMat myGpuMat;
myGpuMat.upload(myMat); //Via a member function
//Or
GpuMat myGpuMat(myMat) //Via a constructor
//Use myGpuMat here...
implicit conversion: GpuMat -> Mat
GpuMat myGpuMat;Mat myMat = myGpyMat; //Use myMat here...
Nessun commento:
Posta un commento