• English
    • 日本語 (Japanese)
Avinton JapanAvinton JapanAvinton JapanAvinton Japan
  • Services
    • Avinton Data Platform
    • Edge AI Camera
    • Private Cloud
    • AI Service Development
  • Blog
  • Avinton Academy
  • Careers
    • Jobs
  • About
    • Company Profile
    • Message from the CEO
    • Sustainability
  • Contact

Install Python2.7 & OpenCV

  • Infrastructure (Server components, RAID)
  • Machine Learning Engineer Skills Required
  • Front End Technologies: Environment
  • Front End Technologies: Demo API
  • Setting Up Ubuntu
  • PostgreSQL Setup
  • REDIS
  • Privacy Policy
  • Loading Data into PostgreSQL & Redis
  • Python with Redis & PostgreSQL
  • Install Python2.7 & OpenCV
  • OpenCV Simple Exercise
  • Image Classification Task
  • Questions
  • Extending VirtualBox Virtual Drive
  • PostgreSQL Data Analyses
  • Infrastructure (server components, RAID)
  • PostgreSQL – Python – Apache – Bootstrap
  • Data Scientist
  • Google Chrome DevTools Basics for Web App Development
Home Avinton Academy Install Python2.7 & OpenCV

Python OpenCV Setup

This was tested with Ubuntu 16.04

Python Install

Make sure we are in our home directory

cd ~


Update & Upgrade OS

Upgrade any currently installed packages (may take a long time)

sudo apt-get update
sudo apt-get upgrade


Install Tools:

sudo apt-get install build-essential
sudo apt-get install cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev
sudo apt-get install python-dev python-numpy
sudo apt-get install -y unzip wget


Install File Format Libs

sudo apt-get install libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev


Install Image -> GUI handler

sudo apt-get install libgtk2.0-dev


If you want to do any Video Processing:

sudo apt-get install libavcodec-dev libavformat-dev libswscale-dev libv4l-dev


Install OpenCV Optimisation Libs

sudo apt-get install libatlas-base-dev gfortran


Install Python Package Manager (PIP)

wget https://bootstrap.pypa.io/get-pip.py
sudo -H python get-pip.py


Install Python 2.7

sudo -H apt-get install python2.7-dev


Install Python Numpy

Numpy is used by Python for Image representation.

sudo pip install numpy


OpenCV Setup

Copy OpenCV Repo

Get OpenCV 3.3 build from GitHub

cd ~
wget https://github.com/opencv/opencv/archive/3.3.0.zip
unzip 3.3.0.zip
mv opencv-3.3.0/ opencv
cd opencv


Build OpenCV

cd ~/opencv
$ mkdir build
$ cd build
$ sudo cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local ..


Compile OpenCV

make -j7


If you run out of disk space on your VM check out the little guide on extending your Virtual Disk
https://avinton.com/en/academy/extending-virtualbox-virtual-drive/

Install OpenCV

sudo make install
sudo ldconfig


Test

python


import cv2
cv2.__version__

The above should return 3.3.0 (The OpenCV Version you installed)


Exit python interpreter and return to terminal

exit()

採用情報

採用情報

Avinton SDGs

SDGsへの貢献

© 2023 Avinton | All Rights Reserved | プライバシーポリシー
  • Services
    • Avinton Data Platform
    • Edge AI Camera
    • Private Cloud
    • AI Service Development
  • Blog
  • Avinton Academy
  • Careers
    • Jobs
  • About
    • Company Profile
    • Message from the CEO
    • Sustainability
  • Contact
  • English
    • 日本語 (Japanese)
Avinton Japan