参考:https://blog.csdn.net/x5675602/article/details/82881841
及https://github.com/opencv/opencv/issues/10771 中dbanda的回答
执行make时遇到问题:
fatal error: pyopencv_generated_include.h: No such file or directory
将cmake降级为3.6.3,gcc和g++降级为6.5.0,问题仍不能解决。后来采取如下方法问题解决:
在…/opencv-3.4.2目录下执行:
python ./modules/python/src2/gen2.py ./build/modules/python_bindings_generator ./build/modules/python_bindings_generator/headers.txt
然后再重新到…/opencv-3.4.2/build目录下执行:make -j12
成功。