Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

why I am not getting Image??

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.

click to hide/show revision 2
No.2 Revision

updated 2015-06-01 03:15:29 -0600

berak gravatar image

why I am not getting Image??

I am trying to load image, but I always get blank window frame.

this is the header file,
    #pragma once

once class project { public: project(void); ~project(void);

~project(void); bool image( char* imgName);

};

imgName); }; this is .cpp file

#include "project.h"

include <opencv2 core="" core.hpp="">

include <opencv2 highgui="" highgui.hpp="">

include "opencv2/imgproc/imgproc.hpp"

file #include "project.h" #include <opencv2/core/core.hpp> #include <opencv2/highgui/highgui.hpp> #include "opencv2/imgproc/imgproc.hpp" using namespace cv;

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();

}

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.

click to hide/show revision 3
No.3 Revision

updated 2015-06-01 03:16:23 -0600

berak gravatar image

why I am not getting Image??

I am trying to load image, but I always get blank window frame.

this is the header file, 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.