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?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With