Ask Your Question

Revision history [back]

First i'm using cmake command to build opencv on my machine (build and install) And testing if my install is correct or wrong with this test.cpp by invoking opencv apis cv::imread

First i'm using cmake command to build opencv on my machine (build and install) And testing if my install is correct or wrong with this test.cpp by invoking opencv apis cv::imread

and here is the test.cpp code

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

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

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

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

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

include <opencv2 cudaarithm.hpp="">

include <opencv2 cudaimgproc.hpp="">

define TestCUDA true

using namespace cv; using namespace std;

int main() { std::clock_t begin = std::clock();

try {
    cv::Mat srcHost = cv::imread("image.png",CV_LOAD_IMAGE_GRAYSCALE); .......

First i'm using cmake command to build opencv on my machine (build and install) And testing if my install is correct or wrong with this test.cpp by invoking opencv apis cv::imread

and here is the test.cpp code

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

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

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

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

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

include <opencv2 cudaarithm.hpp="">

include <opencv2 cudaimgproc.hpp="">

define TestCUDA true

using namespace cv; using namespace std;

int main() { std::clock_t begin = std::clock();

try {
    cv::Mat srcHost = cv::imread("image.png",CV_LOAD_IMAGE_GRAYSCALE); .......

First i'm using cmake command to build opencv on my machine (build and install) And testing if my install is correct or wrong with this test.cpp by invoking opencv apis cv::imreadcv::imread. Anyways i got it. I forgot to link the libraries.