Skip to content

Commit d575d4a

Browse files
author
Dario
committed
Update debs for Raspbian Buster
* Added pre-compiled debs for Raspbian Buster * Restructured project folders * Added C++ test * Updated README / build_information.txt accordingly TO DO: * complete python test with verson / cpu enabled features check
1 parent eb0800b commit d575d4a

20 files changed

+188
-81
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
CMakeLists.txt.user
2+
.clang-format
3+
build/

OpenCV-4.1.0-armv7l-dev.deb

-1.2 MB
Binary file not shown.

OpenCV-4.1.0-armv7l-licenses.deb

-8.48 KB
Binary file not shown.

OpenCV-4.1.0-armv7l-main.deb

-6.61 KB
Binary file not shown.

OpenCV-4.1.0-armv7l-python.deb

-3.83 MB
Binary file not shown.

OpenCV-4.1.0-armv7l-scripts.deb

-1.02 KB
Binary file not shown.

README.md

Lines changed: 45 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,31 @@
1-
# OpenCV 4.1.0 for Raspberry Pi
2-
* A pre-compiled **OpenCV 4.1.0** for **Raspberry Pi**, optimized for deep learning (**NEON**, **VFPV3**, **TBB** turned on).
3-
* Bindings for **Python2** and **Python3** are also included.
4-
* Created with OpenCV cpack targets
5-
* Tested on **Raspberry Pi 3+** using **Raspbian Stretch (Debian 9)**
1+
# Faster OpenCV for Raspberry Pi
2+
Leverage all your CPUs power in OpenCV by using **TBB**, **Neon** and **VFPV3** libraries.
63

7-
# Prerequisites
8-
Before proceeding, install OpenCV library prerequisites.
4+
Since I've already compiled this on my own Raspberry Pi I made it available on GitHub.
5+
6+
Save countless of compile time by just installing these debs. Enjoy!
7+
8+
## What is this?
9+
* A pre-compiled **OpenCV 4.1.0** for **Raspberry Pi** optimized for deep learning / computer vision applications (**NEON**, **VFPV3**, **TBB** turned on).
10+
* Bindings for **Python 2** and **Python 3** are also included.
11+
* For detailed build informations click [here](build_information.txt).
12+
* Created with OpenCV cpack targets.
13+
* Tested on **Raspberry Pi 3** using **Raspbian Buster (Debian 10)** (for Raspbian Stretch click [here](https://github.com/dlime/Faster_OpenCV_4_Raspberry_Pi/releases/tag/stretch_410)).
14+
15+
## How much faster?
16+
Performance tests have been made in this [great blog article](https://www.pyimagesearch.com/2017/10/09/optimizing-opencv-on-the-raspberry-pi/) which led to an approximate **30%** increase in speed and of over **48%** when applied strictly to DNN module.
17+
18+
Another performance test is available [here](https://www.theimpossiblecode.com/blog/faster-opencv-smiles-tbb/) which also led to about **30%** increase in speed.
19+
20+
## How to use it?
21+
Install OpenCV library prerequisites on your Raspberry Pi.
922
```
1023
sudo apt-get update && sudo apt-get upgrade -y
1124
sudo apt-get install -y
12-
libjpeg-dev libpng-dev libtiff-dev \
13-
libavcodec-dev libavformat-dev libswscale-dev libv4l-dev \
25+
libjpeg-dev libpng-dev libtiff-dev libgtk-3-dev \
26+
libavcodec-extra libavformat-dev libswscale-dev libv4l-dev \
1427
libxvidcore-dev libx264-dev libjasper1 libjasper-dev \
15-
libgtk-3-dev \
16-
libatlas-base-dev gfortran \
17-
libeigen3-dev libtbb-dev
28+
libatlas-base-dev gfortran libeigen3-dev libtbb-dev
1829
```
1930

2031
Install **numpy** based on your target Python version:
@@ -26,31 +37,38 @@ or:
2637
sudo apt-get install -y python-dev python-numpy
2738
```
2839

29-
# How to install OpenCV
30-
Download and run dpkg on all the .deb in the repository:
40+
### How to install?
41+
Clone the repo into your Raspberry Pi and install all debs:
3142
```
32-
git clone https://github.com/dlime/OpenCV_4_Raspberry_PI.git
33-
cd OpenCV_4_Raspberry_PI
34-
sudo dpkg -i OpenCV*
43+
git clone https://github.com/dlime/Faster_OpenCV_4_Raspberry_Pi.git
44+
cd Faster_OpenCV_4_Raspberry_Pi/debs
45+
sudo dpkg -i OpenCV*.deb
3546
sudo ldconfig
3647
```
3748

38-
# How to test
39-
Go to test folder and launch the test.py file:
49+
### How to test?
50+
51+
#### C++
52+
Test the installation by going to tests cpp test folder, build it and launch the executable:
4053
```
41-
cd OpenCV_4_Raspberry_PI/test
42-
sudo pip2 install imutils
43-
python2 test.py
54+
cd Faster_OpenCV_4_Raspberry_Pi/tests/cpp_opencv_test
55+
mkdir build && cd build
56+
cmake ..
57+
make -j`cat /proc/cpuinfo | grep -c 'processor'`
58+
./cpp_opencv_test
4459
```
4560

46-
Or for Python 3:
61+
#### Python
62+
Test the installation by going to tests folder and launch the test.py file:
4763
```
48-
cd OpenCV_4_Raspberry_PI/test
49-
sudo pip3 install imutils
50-
python3 test.py
64+
cd Faster_OpenCV_4_Raspberry_Pi/tests/python_opencv_test
65+
python test.py
5166
```
5267

53-
# How to uninstall
68+
You shouldn't see any error messages in console and an image with tetris blocks with contours drawed should appear.
69+
70+
### How to uninstall?
71+
Run the following command in your Raspberry Pi terminal:
5472
```
5573
sudo apt purge opencv-*
5674
```

build_information.txt

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ General configuration for OpenCV 4.1.0 =====================================
66
Version control (extra): unknown
77

88
Platform:
9-
Timestamp: 2019-06-29T23:05:52Z
10-
Host: Linux 4.19.42-v7+ armv7l
11-
CMake: 3.7.2
12-
CMake generator: Unix Makefiles
13-
CMake build tool: /usr/bin/make
9+
Timestamp: 2019-07-02T18:18:19Z
10+
Host: Linux 4.19.50-v7+ armv7l
11+
CMake: 3.13.4
12+
CMake generator: Ninja
13+
CMake build tool: /usr/bin/ninja
1414
Configuration: Release
1515

1616
CPU/HW features:
@@ -20,12 +20,12 @@ General configuration for OpenCV 4.1.0 =====================================
2020

2121
C/C++:
2222
Built as dynamic libs?: YES
23-
C++ Compiler: /usr/bin/c++ (ver 6.3.0)
24-
C++ flags (Release): -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-comment -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -mfpu=neon -mfp16-format=ieee -fvisibility=hidden -fvisibility-inlines-hidden -O3 -DNDEBUG -DNDEBUG
25-
C++ flags (Debug): -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-comment -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -mfpu=neon -mfp16-format=ieee -fvisibility=hidden -fvisibility-inlines-hidden -g -O0 -DDEBUG -D_DEBUG
23+
C++ Compiler: /usr/bin/c++ (ver 8.3.0)
24+
C++ flags (Release): -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -mfpu=neon -mfp16-format=ieee -fvisibility=hidden -fvisibility-inlines-hidden -O3 -DNDEBUG -DNDEBUG
25+
C++ flags (Debug): -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -mfpu=neon -mfp16-format=ieee -fvisibility=hidden -fvisibility-inlines-hidden -g -O0 -DDEBUG -D_DEBUG
2626
C Compiler: /usr/bin/cc
27-
C flags (Release): -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Winit-self -Wno-comment -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -mfpu=neon -mfp16-format=ieee -fvisibility=hidden -O3 -DNDEBUG -DNDEBUG
28-
C flags (Debug): -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Winit-self -Wno-comment -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -mfpu=neon -mfp16-format=ieee -fvisibility=hidden -g -O0 -DDEBUG -D_DEBUG
27+
C flags (Release): -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Winit-self -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -mfpu=neon -mfp16-format=ieee -fvisibility=hidden -O3 -DNDEBUG -DNDEBUG
28+
C flags (Debug): -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Winit-self -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -mfpu=neon -mfp16-format=ieee -fvisibility=hidden -g -O0 -DDEBUG -D_DEBUG
2929
Linker flags (Release): -Wl,--gc-sections
3030
Linker flags (Debug): -Wl,--gc-sections
3131
ccache: YES
@@ -43,17 +43,17 @@ General configuration for OpenCV 4.1.0 =====================================
4343
Non-free algorithms: YES
4444

4545
GUI:
46-
GTK+: YES (ver 3.22.11)
47-
GThread : YES (ver 2.50.3)
46+
GTK+: YES (ver 3.24.5)
47+
GThread : YES (ver 2.58.3)
4848
GtkGlExt: NO
4949
VTK support: NO
5050

5151
Media I/O:
52-
ZLib: /usr/lib/arm-linux-gnueabihf/libz.so (ver 1.2.8)
52+
ZLib: /usr/lib/arm-linux-gnueabihf/libz.so (ver 1.2.11)
5353
JPEG: /usr/lib/arm-linux-gnueabihf/libjpeg.so (ver 62)
5454
WEBP: build (ver encoder: 0x020e)
55-
PNG: /usr/lib/arm-linux-gnueabihf/libpng.so (ver 1.6.28)
56-
TIFF: /usr/lib/arm-linux-gnueabihf/libtiff.so (ver 42 / 4.0.8)
55+
PNG: /usr/lib/arm-linux-gnueabihf/libpng.so (ver 1.6.36)
56+
TIFF: /usr/lib/arm-linux-gnueabihf/libtiff.so (ver 42 / 4.0.10)
5757
JPEG 2000: /usr/lib/arm-linux-gnueabihf/libjasper.so (ver 1.900.1)
5858
OpenEXR: build (ver 1.7.1)
5959
HDR: YES
@@ -64,21 +64,21 @@ General configuration for OpenCV 4.1.0 =====================================
6464
Video I/O:
6565
DC1394: NO
6666
FFMPEG: YES
67-
avcodec: YES (57.64.101)
68-
avformat: YES (57.56.101)
69-
avutil: YES (55.34.101)
70-
swscale: YES (4.2.100)
67+
avcodec: YES (58.35.100)
68+
avformat: YES (58.20.100)
69+
avutil: YES (56.22.100)
70+
swscale: YES (5.3.100)
7171
avresample: NO
7272
GStreamer: NO
7373
v4l/v4l2: YES (linux/videodev2.h)
7474

75-
Parallel framework: TBB (ver 4.3 interface 8006)
75+
Parallel framework: TBB (ver 2018.0 interface 10006)
7676

7777
Trace: YES (built-in)
7878

7979
Other third-party libraries:
8080
Lapack: NO
81-
Eigen: YES (ver 3.3.2)
81+
Eigen: YES (ver 3.3.7)
8282
Custom HAL: YES (carotene (ver 0.0.1))
8383
Protobuf: build (3.5.1)
8484

@@ -87,16 +87,16 @@ General configuration for OpenCV 4.1.0 =====================================
8787
Link libraries: Dynamic load
8888

8989
Python 2:
90-
Interpreter: /usr/bin/python2.7 (ver 2.7.13)
91-
Libraries: /usr/lib/arm-linux-gnueabihf/libpython2.7.so (ver 2.7.13)
92-
numpy: /usr/lib/python2.7/dist-packages/numpy/core/include (ver 1.12.1)
90+
Interpreter: /usr/bin/python2.7 (ver 2.7.16)
91+
Libraries: /usr/lib/arm-linux-gnueabihf/libpython2.7.so (ver 2.7.16)
92+
numpy: /usr/lib/python2.7/dist-packages/numpy/core/include (ver 1.16.2)
9393
install path: lib/python2.7/dist-packages/cv2/python-2.7
9494

9595
Python 3:
96-
Interpreter: /usr/bin/python3 (ver 3.5.3)
97-
Libraries: /usr/lib/arm-linux-gnueabihf/libpython3.5m.so (ver 3.5.3)
98-
numpy: /usr/lib/python3/dist-packages/numpy/core/include (ver 1.12.1)
99-
install path: lib/python3.5/dist-packages/cv2/python-3.5
96+
Interpreter: /usr/bin/python3 (ver 3.7.3)
97+
Libraries: /usr/lib/arm-linux-gnueabihf/libpython3.7m.so (ver 3.7.3)
98+
numpy: /usr/lib/python3/dist-packages/numpy/core/include (ver 1.16.2)
99+
install path: lib/python3.7/dist-packages/cv2/python-3.7
100100

101101
Python (for build): /usr/bin/python2.7
102102

debs/OpenCV-4.1.0-armv7l-dev.deb

1.2 MB
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)