Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

whats the difference between # include "opencv2/highgui/highgui.hpp" and # include "opencv2/highgui.hpp"

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?

like image 890
DDDAD Avatar asked Oct 14 '25 03:10

DDDAD


1 Answers

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.

like image 179
Catree Avatar answered Oct 17 '25 21:10

Catree



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!