Ask Your Question

Revision history [back]

cant read image from .cu

why i cant run this code in .cu file while in cpp file is working?

#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <iostream>

using namespace cv;
using namespace std;

int main(int argc, char** argv)
{
  Mat image;
  image = imread("D://1.jpg", CV_LOAD_IMAGE_COLOR); 
  if (!image.data) 
  {
    return -1;
  }
  namedWindow("Display window", WINDOW_AUTOSIZE);
  imshow("Display window", image); 
  waitKey(0);
  return 0;
}