当前位置:   article > 正文

Install opencv in termux_termux python opencv

termux python opencv

Refer to https://wiki.termux.com/wiki/Instructions_for_installing_python_packages#opencv
1. Install python3 and dev
     pkg install python python-dev
2. Install tools and libs
     pkg install libjpeg-turbo-dev libpng-dev cmake pkg-config
3. Clone opencv from git
    git clone https://github.com/opencv/opencv && cd opencv
4. Create build directory
     mkdir build && cd build
5. Configure
LDFLAGS=" -llog -lpython3" cmake -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=$PREFIX -DBUILD_opencv_python3=on -DBUILD_opencv_python2=off -DWITH_QT=OFF -DWITH_GTK=OFF ..
Don't missing the double dot at the end of command, It means start from the parent folder. After success, execute the following command:
     make
     make install
Please be noted that make will take a long time.
6. After installed, test it in python
     python
     >>> import cv2
     >>>cv2.__version__
    If no error it will print the version

Note: don'tt install python2, cmake will confuse with it and when import cv will face error.

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/盐析白兔/article/detail/394004
推荐阅读
相关标签
  

闽ICP备14008679号