GithubHelp home page GithubHelp logo

dlime / faster_opencv_4_raspberry_pi Goto Github PK

View Code? Open in Web Editor NEW
58.0 5.0 16.0 119.11 MB

A pre-compiled version of OpenCV 4 for Raspberry Pi optimized for deep learning / computer vision..

License: BSD 2-Clause "Simplified" License

Python 39.38% CMake 10.45% C++ 50.17%
raspberry-pi neon python2-python3 vfpv3 deep-learning opencv4 opencv3-python opencv-python debian-packages raspbian

faster_opencv_4_raspberry_pi's Introduction

Faster OpenCV for Raspberry Pi

Leverage all your CPUs power in OpenCV by using TBB, Neon and VFPV3 libraries.

Since I've already compiled this on my own Raspberry Pi I made it available on GitHub.

Save countless of compile time by just installing these debs. Enjoy!

What is this?

  • A pre-compiled OpenCV 4.4.0 for Raspberry Pi optimized for deep learning / computer vision applications (NEON, VFPV3, TBB turned on).
  • Bindings for Python 2 and Python 3 are also included.
  • For detailed build informations click here.
  • Created with OpenCV cpack targets.
  • Tested on Raspberry Pi 3 using Raspbian Buster (Debian 10) (for Raspbian Stretch click here).

How much faster?

Performance tests have been made in this great blog article which led to an approximate 30% increase in speed and of over 48% when applied strictly to DNN module.

Another performance test is available here which also led to about 30% increase in speed.

How to use it?

Install OpenCV library prerequisites on your Raspberry Pi.

sudo apt-get update && sudo apt-get upgrade -y
sudo apt-get install -y \
	libjpeg-dev libpng-dev libtiff-dev libgtk-3-dev \
	libavcodec-extra libavformat-dev libswscale-dev libv4l-dev \
	libxvidcore-dev libx264-dev libjasper1 libjasper-dev \
	libatlas-base-dev gfortran libeigen3-dev libtbb-dev

Install numpy based on your target Python version:

sudo apt-get install -y python3-dev python3-numpy

or:

sudo apt-get install -y python-dev python-numpy

How to install?

Clone the repo into your Raspberry Pi and install all debs:

git clone https://github.com/dlime/Faster_OpenCV_4_Raspberry_Pi.git
cd Faster_OpenCV_4_Raspberry_Pi/debs
sudo dpkg -i OpenCV*.deb
sudo ldconfig

How to test?

C++

Test the installation by going to tests cpp test folder, build it and launch the executable:

cd Faster_OpenCV_4_Raspberry_Pi/tests/cpp_opencv_test
mkdir build && cd build
cmake ..
make -j`cat /proc/cpuinfo | grep -c 'processor'`
./cpp_opencv_test

Python

Test the installation by going to tests folder and launch the test.py file:

cd Faster_OpenCV_4_Raspberry_Pi/tests/python_opencv_test
python test.py

You shouldn't see any error messages in console and an image with tetris blocks with contours drawed should appear.

How to uninstall?

Run the following command in your Raspberry Pi terminal:

sudo apt purge opencv-*

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.