ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I would vote for the includes, and the C-style function.

include <highgui.h>

include <cv.h>

With these I'm not sure that you'll get what you need. The right way to do the includes is

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

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

Those includes above will reference to the old legacy versions of opencv still available in some Ubuntu versions.

Also if you are developing a new code (and I can see that it's C++) please use the new C++ API to easily avoid problems like memory leaks and such. Too bad that 95% of the example materials that can be found (official&unofficial) on OpenCV are still advertising the old API. For example your line of code would look like this:

if( !cv::imread("13_45_07-65.bmp").empty() ) cout << "sorry" << endl;

I would vote for the includes, and the C-style function.

include <highgui.h>

include <cv.h>

With these I'm not sure that you'll get what you need. The right way to do the includes is

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

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

Those includes above will reference to the old legacy versions of opencv still available in some Ubuntu versions.

Also if you are developing a new code (and I can see that it's C++) please use the new C++ API to easily avoid problems like memory leaks and such. Too bad that 95% of the example materials that can be found (official&unofficial) on OpenCV are still advertising the old API. For example your line of code would look like this:

if( !cv::imread("13_45_07-65.bmp").empty() ) cout << "sorry" << endl;

I would vote for the includes, and the C-style function.

include <highgui.h>

include <cv.h>

With these I'm not sure that you'll get what you need. The right way to do the includes is

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

core.hpp="">

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

Those includes above will reference to the old legacy versions of opencv still available in some Ubuntu versions.

Also if you are developing a new code (and I can see that it's C++) please use the new C++ API to easily avoid problems like memory leaks and such. Too bad that 95% of the example materials that can be found (official&unofficial) on OpenCV are still advertising the old API. For example your line of code would look like this:

if( !cv::imread("13_45_07-65.bmp").empty() ) cout << "sorry" << endl;

I would vote for the includes, and the C-style function.

include <highgui.h>

include <cv.h>

With these I'm not sure that you'll get what you need. The right way to do the includes is

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

#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>

Those includes above will reference to the old legacy versions of opencv still available in some Ubuntu versions.

Also if you are developing a new code (and I can see that it's C++) please use the new C++ API to easily avoid problems like memory leaks and such. Too bad that 95% of the example materials that can be found (official&unofficial) on OpenCV are still advertising the old API. For example your line of code would look like this:

if( !cv::imread("13_45_07-65.bmp").empty() ) cout << "sorry" << endl;

I would vote for the includes, and the C-style function.

#include <highgui.h>   

include <highgui.h>

include <cv.h>

#include <cv.h>

With these I'm not sure that you'll get what you need. The right way to do the includes is

#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>

Those includes above will reference to the old legacy versions of opencv still available in some Ubuntu versions.

Also if you are developing a new code (and I can see that it's C++) please use the new C++ API to easily avoid problems like memory leaks and such. Too bad that 95% of the example materials that can be found (official&unofficial) on OpenCV are still advertising the old API. For example your line of code would look like this:

if( !cv::imread("13_45_07-65.bmp").empty() )
     cout << "sorry" << endl;

endl;

I would vote for the includes, and the C-style function.

#include <highgui.h> 
#include <cv.h>

With these I'm not sure that you'll get what you need. The right way to do the includes is

#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>

Those includes above will reference to the old legacy versions of opencv still available in some Ubuntu versions.

Also if you are developing a new code (and I can see that it's C++) please use the new C++ API to easily avoid problems like memory leaks and such. Too bad that 95% of the example materials that can be found (official&unofficial) on OpenCV are still advertising the old API. For example your line of code would look like this:

if( !cv::imread("13_45_07-65.bmp").empty() !(cv::imread("13_45_07-65.bmp").empty()) )
    cout << "sorry" << endl;

I would vote for the includes, and the C-style function.

#include <highgui.h> 
#include <cv.h>

With these I'm not sure that you'll get what you need. The right way to do the includes is

#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>

Those includes above will reference to the old legacy versions of opencv still available in some Ubuntu versions.

Also if you are developing a new code (and I can see that it's C++) please use the new C++ API to easily avoid problems like memory leaks and such. Too bad that 95% of the example materials that can be found (official&unofficial) on OpenCV are still advertising the old API. For example your line of code would look like this:

if( !(cv::imread("13_45_07-65.bmp").empty()) cv::imread("13_45_07-65.bmp").empty() )
    cout << "sorry" << endl;