I am trying to load image, but I always get blank window frame.
this is the header file, #pragma once
class project { public: project(void); ~project(void);
bool image( char* imgName);
};
this is .cpp file
#include "project.h"
include <opencv2 core="" core.hpp="">
include <opencv2 highgui="" highgui.hpp="">
include "opencv2/imgproc/imgproc.hpp"
using namespace cv;
project::project(void) { }
project::~project(void) { }
bool project::image(char* imgName) {
Mat imgOriginal = imread(imgName);
imshow("original", imgOriginal);
return 0;
}
this is the main.cpp file
#include "project.h"
include <iostream>
include <string>
using namespace std;
int main() { project ob1; ob1.image("2.JPG");
getchar();
}
can someone please guide me where I am getting error. Thank you very much in advance.