Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
<!--
SPDX-FileCopyrightText: 2023 Arm Limited and/or its affiliates <open-source-office@arm.com>
SPDX-License-Identifier: Apache-2.0
-->
---
**NOT SUITABLE FOR DEPLOYMENT OR PRODUCTION USE**
---
# IntrinsicCV
This project is in the early stages of development and is not ready for use
except as a preview.
This is a Computer Vision Library aiming to give high-performing image
processing functions on Arm. It is designed to be simple to import into a wide variety
of projects.
Library provides a C interface.
Adapter is provided currently to:
* OpenCV
# Structure
The directory `intrinsiccv` contains generic implementation of the library.
Integration with other projects are stored in `adapters` folder. `test` contains
API and unit tests for the library. All supporting scripts are located in
`scripts`.
# Standalone build
The library can be built using CMake:
```
cmake -S /path/to/intrinsiccv -B build-intrinsiccv -DCMAKE_TOOLCHAIN_FILE=/path/to/android-ndk/build/cmake/android.toolchain.cmake -DANDROID_ABI=arm64-v8a
cmake --build build-intrinsiccv --parallel
```
Builds scripts for Linux/macOS are also provided for convenience. To target Android
devices the following command should work:
```
BUILD_ID=android \
CMAKE_TOOLCHAIN_FILE=/path/to/android-ndk/build/cmake/android.toolchain.cmake \
EXTRA_CMAKE_ARGS="-DANDROID_ABI=arm64-v8a" \
scripts/build.sh
```
For further options please refer to the documentation in `./scripts/build.sh`.
# Build and run tests
To build all the tests target `intrinsiccv-test`, to also run them use
`check-intrinsiccv` and set a proper `CMAKE_CROSSCOMPILING_EMULATOR`.
To build all tests for Android:
```
BUILD_ID=android \
CMAKE_TOOLCHAIN_FILE=/path/to/android-ndk/build/cmake/android.toolchain.cmake \
EXTRA_CMAKE_ARGS="-DANDROID_ABI=arm64-v8a" \
scripts/build.sh intrinsiccv-test
```
To build and run all tests for Android with a single command:
```
BUILD_ID=android \
CMAKE_TOOLCHAIN_FILE=/path/to/android-ndk/build/cmake/android.toolchain.cmake \
ADB=<path to adb executable of choice> \
CMAKE_CROSSCOMPILING_EMULATOR="<path to intrinsiccv>/scripts/test_android.sh;<path to intrinsiccv>/build/<build_id>" \
EXTRA_CMAKE_ARGS="-DANDROID_ABI=arm64-v8a" \
scripts/build.sh check-intrinsiccv
```
# Building with OpenCV
## Install
This library is compatible with [OpenCV](https://opencv.org) version 5.x.
Integration consists of the following steps:
1. Download OpenCV sources:
```
git clone https://github.com/opencv/opencv
cd opencv
git checkout 67a3d35b4ea1b11136042cdf5072a634d6789984
```
2. Patch OpenCV:
```
git apply /path/to/intrinsiccv/adapters/opencv/opencv-5.x.patch
```
## Build Library
The project can be built using standard cmake and ninja.
```
cmake \
-S /path/to/opencv \
-B build-opencv \
-G Ninja \
-DWITH_INTRINSICCV=ON \
-DINTRINSICCV_SOURCE_PATH=/path/to/intrinsiccv \
-DCMAKE_TOOLCHAIN_FILE=/path/to/android-ndk/build/cmake/android.toolchain.cmake \
-DANDROID_ABI=arm64-v8a \
-DCMAKE_CXX_STANDARD=14 \
-DBUILD_ANDROID_EXAMPLE=OFF \
-DBUILD_ANDROID_PROJECTS=OFF \
-DBUILD_TESTS=OFF \
-DBUILD_PERF_TESTS=OFF
cmake --build build-opencv --parallel
```
### Dependencies
There are only a few dependencies and requirements:
- [cmake](https://cmake.org) version 3.16 or newer (3.21 is recommended),
- [ninja](https://ninja-build.org),
- [gcovr](https://gcovr.com/) and its dependencies for coverage reports,
- [rsync](https://linux.die.net/man/1/rsync) for coverage reports,
- recent version of [llvm](https://llvm.org), preferably 17 or newer.
OpenCV has its own
[dependencies](https://docs.opencv.org/5.x/d7/d9f/tutorial_linux_install.html).