My library currently uses OpenCV 2. Now, I am trying to compile the library to use OpenCV 3. It seems that some header files were moved and some constants were renamed. For exam
The OpenCV guys have put up a transition guide online : http://docs.opencv.org/master/db/dfa/tutorial_transition_guide.html
In essence I think the following have changed:-
As for code working with Opencv3 and opencv2, I usually introduce a prepocessor directive which holds a flag:-
#define HAS_OPENCV3 1
#ifdef HAS_OPENCV3
#include //Any OPENCV3 code
#else
#include //Any Opencv2 code
#endif
Since the relative portions are eliminated before compilation, it will also compile with only the OpenCV2 or OpenCV3 libraries. But, introduces a lot of redundancy (which can be avoided by some clever coding).