Proper #include for function

asked 2018-07-16 12:12:09 -0500

tommy61157 gravatar image

Hello, I'm running one of the 4.0.0 dev builds for OpenCV and I had a question. I think #include highgui.h used to take care of it, but now that doesn't seem to be helping since CV_CALIB_CB_ADAPTIVE_THRESH and CV_CALIB_CB_FILTER_QUADS both are saying undefined and I'm not sure what the proper include would be. I would definitely appreciate anyone who could tell me what file I need to include in this version to get it to no longer be undefined, thanks :)

edit retag flag offensive close merge delete

Comments

please note , that the CV_ prefixes were dropped (whith a few exceptions for CV_8U and similar) with opencv3.0 already.

to access most of those, you'd have to use the deprecated c-api headers, like "opencv2/calib3d_c.h"

(simply try without, like cv::CALIB_CB_ADAPTIVE)

berak gravatar imageberak ( 2018-07-16 12:22:32 -0500 )edit

and you should use

#include "opencv2/highgui.hpp"
#include "opencv2/calib3d.hpp"

now.

berak gravatar imageberak ( 2018-07-16 12:23:36 -0500 )edit

Okay, so doing the highgui.hpp thing fixed that, but then made my CV_BGR2GRAY, CV_TERMCRIT_EPS, and CV_TERMCRIT_ITER not work, so I still had to keep the include highgui.h and keep them with the CV in front, unless you know a way to properly do those too.

tommy61157 gravatar imagetommy61157 ( 2018-07-16 12:30:43 -0500 )edit

yea, it's a bit painful. some of those were entirely renamed, like:

COLOR_BGR2GRAY
TermCriteria::EPS
TermCriteria::MAX_ITER

my advice here: use the searchbar with current docs , try to find the function, that uses those flags, and dig your way in from there.

and again, those changes were made during the transition to 3.0, you're a couple of years late with your problem !

berak gravatar imageberak ( 2018-07-16 12:39:03 -0500 )edit

Okay, I see, put both of your comments on here as an answer, and I'll mark that as the answer as this solved the problem and I did get certain ones to work that weren't working since it turns out I was putting them in wrong in the first place, I'm having a separate problem with Json, but it's not related to OpenCV directly, so I won't post it here.

tommy61157 gravatar imagetommy61157 ( 2018-07-18 06:58:40 -0500 )edit