8 Replies Latest reply on Mar 23, 2015 4:30 AM by mhahn

    intel galileo gen 2 iot displaying a picture using imshow() namedWindow()

    annu_shah

      hi,

      i am using a very basic code on the iot to capture an image from camera and  view it ,but i get this error :-

       

      Gtk-WARNING **: cannot open display:

       

      This is my code :-

       

       

      #include <opencv2/opencv.hpp>

      #include <math.h>

      using namespace cv;

      void sobelFilter(Mat , Mat , int , int );

      int main(int argc, char *argv[])

      {

       

       

      VideoCapture cap(0); //intialize camera

       

       

      for(;;)

      {

       

       

      Mat image;

      cap.read(image);

      //cap.release(); //turn the camera off

      namedWindow( "webcam image", CV_WINDOW_AUTOSIZE );

      imshow("webcam image", image);

      imwrite("webcam_image.jpg", image);

      if(waitKey(30) >= 0) break;

       

       

      }

      return 0;

      }