In my prev problem, I found out that the image doesn't load in my project when I use OpenCV 2.4 so I couldn't create CSV file.
when I was using OpenCV 3.0.0 every thing was OK and I could load the image via imread
but now I'm using OpenCV 2.4 but the image doesn't load and always img.empty() command return true
here is my code but the img is null:
// faceRecognitionTest.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
#include <string>
#include "opencv2\contrib\contrib.hpp"
#include "opencv2\core\core.hpp"
#include "opencv2\highgui\highgui.hpp"
#include "opencv2\objdetect\objdetect.hpp"
#include "opencv2\opencv.hpp"
#include "opencv2\imgproc\imgproc.hpp"
#include "FaceRec.h"
//file handling
#include <fstream>
#include <sstream>
using namespace std;
using namespace cv;
Mat img;
bool b=false;
int _tmain(int argc, _TCHAR* argv[])
{
img = imread("f.jpg",CV_LOAD_IMAGE_GRAYSCALE);
if (b=img.empty())
{
return -1;
}
saveMatToCsv(img,"mycs.csv");
//fisherFaceTrainer();
return 0;
}