Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

load csv file and display image

hi... i am trying to load a csv file and display the images.. but it blank image... someone help me wit this... thanks in advance.

      #include "opencv2/core.hpp"
      #include "opencv2/highgui.hpp"
      #include "opencv2/face.hpp"
      #include "opencv2/ml.hpp"
      #include "opencv2/imgproc.hpp"
      #include <iostream>
     #include <fstream>
     #include <sstream>
     using namespace std;
     using namespace cv;
     using namespace cv::face;

      int main()
      {
     Mat img;
   cv::Ptr<cv::ml::TrainData> raw_data = cv::ml::TrainData::loadFromCSV("///home/veena/Desktop/1_seq40.csv", 0, -2, 0);
   Mat tdata = raw_data->getSamples();
   tdata.convertTo(img, CV_8UC3);
   img.convertTo(img, CV_8UC3);
  resize(img, img, Size(300,300));
  namedWindow("img");
  imshow("img", img);
  waitKey(0);
  return 0;
 }

load csv file and display image

hi... i am trying to load a csv file and display the images.. but it showing blank image... someone plz help me wit this... thanks in advance.

      #include "opencv2/core.hpp"
      #include "opencv2/highgui.hpp"
      #include "opencv2/face.hpp"
      #include "opencv2/ml.hpp"
      #include "opencv2/imgproc.hpp"
      #include <iostream>
     #include <fstream>
     #include <sstream>
     using namespace std;
     using namespace cv;
     using namespace cv::face;

      int main()
      {
     Mat img;
   cv::Ptr<cv::ml::TrainData> raw_data = cv::ml::TrainData::loadFromCSV("///home/veena/Desktop/1_seq40.csv", 0, -2, 0);
   Mat tdata = raw_data->getSamples();
   tdata.convertTo(img, CV_8UC3);
   img.convertTo(img, CV_8UC3);
  resize(img, img, Size(300,300));
  namedWindow("img");
  imshow("img", img);
  waitKey(0);
  return 0;
 }