whats the difference between # include "opencv2/highgui/highgui.hpp" and # include "opencv2/highgui.hpp"
c++, header, include, opencv
Solution
It is a legitimate question in my opinion. Quote from the OpenCV documentation:
Headers layout
In 2.4 all headers are located in corresponding module subfolder (opencv2/module/module.hpp), in 3.0 there are top-level module headers containing the most of the module functionality: opencv2/module.hpp and all C-style API definitions have been moved to separate headers (for example opencv2/core/core_c.h).
If you are using OpenCV 3, you can use both syntax but it is preferable to use the latter one (`opencv2/highgui.hpp`).
Use the first one (`opencv2/highgui/highgui.hpp`) if you are using OpenCV 2.4 or want your program to be backward compatible with OpenCV 2.4.
Problem
Some programs have the first one, while others have the second one. What is the difference between the two, and when do we use them?