I am using CImg to read a .png file, like following:
// DGT.cpp : Defines the entry point for the console application.
#include "stdafx.h"
#include <iostream>
#include <fstream>
#include "..\CImg\CImg.h"
using namespace std;
using namespace cimg_library;
long ReadImage(char *fileName)
{
CImg<unsigned char> image(fileName); // stackover flow exceptions thrown here.
return 0;
}
int _tmain(int argc, _TCHAR* argv[])
{
ReadImage("D:\\Projects\\DGT\\DGT\\shepplogan256.png");
return 0;
}
However, the stack overflown exceptions is thrown at CImg<unsigned char> image(fileName);
when trying to load the image. The image is there, so I am wondering where I messed up and how to read the image?