You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Core depthai library for interfacing with Luxonis DepthAI hardware.
7
+
DepthAI library for interfacing with Luxonis DepthAI hardware.
8
8
9
-
> ⚠️ This is a `v3_develop` branch of library which is still in active development without a stable API yet.
9
+
> ⚠️ This is a `v3.x.y` version of the library which is still in active development without a stable API yet.
10
10
11
11
12
12
## Documentation
13
-
Documentation is available over at [Luxonis DepthAI API](https://docs.luxonis.com/projects/api/en/latest/)
13
+
Documentation is available over at [Luxonis DepthAI API](https://stg.docs.luxonis.com/software/v3/)
14
14
15
15
## Disclaimer
16
16
DepthAI library doesn't yet provide API stability guarantees. While we take care to properly deprecate old functions, some changes might still be breaking.
@@ -19,11 +19,13 @@ DepthAI library doesn't yet provide API stability guarantees. While we take care
19
19
Examples for both C++ and Python are available in the `examples` folder. To get started with them see [README.md](./examples/README.md) for more information.
20
20
21
21
## Dependencies
22
-
- CMake >= 3.14
22
+
- CMake >= 3.14 and <4.0
23
23
- C/C++17 compiler
24
24
-[optional] OpenCV 4 (required if building examples and for record and replay)
25
25
-[optional] PCL (required for point cloud example)
26
26
27
+
> ℹ️ We'll be adding support for CMake 4 shortly.
28
+
27
29
To install OpenCV:
28
30
MacOS: `brew install opencv`
29
31
Linux: `sudo apt install libopencv-dev`
@@ -32,9 +34,20 @@ To install PCL:
32
34
MacOS: `brew install pcl`
33
35
Linux: `sudo apt install libpcl-dev`
34
36
35
-
## Python specific information
37
+
## Using Python bindings
38
+
Installing the latest pre-released version of the library can be done with:
cmake --build build_integration --target test --parallel [num CPU cores]
85
90
```
86
91
87
-
## Integration
88
-
92
+
### Prebuilt library on Windows
89
93
Under releases you may find prebuilt library for Windows, for use in either integration method. See [Releases](https://github.com/luxonis/depthai-core/releases)
90
94
91
-
### CMake
95
+
### Using find_package for integration
92
96
93
-
Targets available to link to are:
94
-
- depthai::core - Core library, without using opencv internally
95
-
- depthai::opencv - Core + support for opencv related helper functions (requires OpenCV4)
97
+
> ℹ️ Due to a non-trivial dependency tree, the integration with `add_subdirectory` is not supported. Use `find_package` instead.
96
98
97
-
#### Using find_package
99
+
First install the library as described in [Installation and Integration](#installation-and-integration) section.
98
100
99
-
Build static or dynamic version of library (See: [Building](#building) and optionally [Installing](#installing))
101
+
Then in your CMake project, add the following lines to your `CMakeLists.txt` file:
102
+
103
+
```cmake
104
+
105
+
# Add `find_package` and `target_link_libraries` to your project
100
106
101
-
Add `find_package` and `target_link_libraries` to your project
If library was installed to default search path like `/usr/local` on Linux, specifying `depthai_DIR` isn't necessary as CMake will find it automatically.
118
117
119
-
#### Using add_subdirectory
118
+
If library was installed to default search path like `/usr/local` on Linux, specifying `CMAKE_PREFIX_PATH` isn't necessary as CMake will find it automatically.
119
+
120
120
121
-
This method is more intrusive but simpler as it doesn't require building the library separately.
121
+
### Vcpkg integration
122
+
For VCPKG integration, check out the example [here](https://github.com/luxonis/depthai_vcpkg_example).
123
+
Note that the VCPKG integration is using a custom branch of DepthAI and we plan to integrate the support for it into the main branch in the future and add it to the official VCPKG repository.
122
124
123
-
Add `add_subdirectory` which points to `depthai-core` folder **before** project command. Then link to any required targets.
125
+
126
+
### Android
127
+
Android is not yet supported on the v3.x.y version of DepthAI. You can still use the v2.x.y version of DepthAI for RVC2 devices or open an issue on this repository to request Android support for v3.x.y.
128
+
129
+
<!-- Steps:
130
+
131
+
- Install Android NDK (for example via Android Studio).
To integrate into a different build system than CMake, prefered way is compiling as dynamic library and setting correct build options.
135
151
1. First build as dynamic library: [Building Dynamic library](#dynamic-library)
@@ -147,18 +163,15 @@ In your non-CMake project (new Visual Studio project, ...)
147
163
> ℹ️ Threading library might need to be linked to explicitly.
148
164
149
165
> ℹ️ Check `build/depthai-core-integration.txt` or `build/depthai-opencv-integration.txt` for up to date define options.
150
-
The generated integration file also specifies include paths without requiring installation.
166
+
The generated integration file also specifies include paths without requiring installation.-->
151
167
152
-
## Installing
168
+
## CMake options
169
+
Many features of the library can be disabled or enabled using CMake options.
170
+
One common option when building the library tests and examples is `DEPTHAI_VCPKG_INTERNAL_ONLY=OFF` which installs a predictable version of OpenCV, PCL and other optional dependencies we also use on the libraries interface.
153
171
154
-
To install specify optional prefix and build target install
If `CMAKE_INSTALL_PREFIX` isn't specified, the library is installed under build folder `install`.
172
+
> ℹ️ When `DEPTHAI_VCPKG_INTERNAL_ONLY=OFF` is used, the library cannot be installed (apart from being installed in the scope of the vcpkg package manager).
161
173
174
+
For a full list of options, see `cmake/depthaiOptions.cmake` file.
162
175
163
176
## Environment variables
164
177
@@ -179,7 +192,7 @@ The following environment variables can be set to alter default behavior of the
179
192
| DEPTHAI_PLATFORM | Restricts default search to the specified platform. Options: `any`, `rvc2`, `rvc3`, `rvc4`. |
180
193
| DEPTHAI_DEVICE_MXID_LIST | Restricts default search to the specified MXIDs. Accepts comma separated list of MXIDs. Lists filter results in an "AND" manner and not "OR" |
181
194
| DEPTHAI_DEVICE_ID_LIST | Alias to MXID list. Lists filter results in an "AND" manner and not "OR" |
182
-
| DEPTHAI_DEVICE_NAME_LIST | Restricts default search to the specified NAMEs. Accepts comma separated list of NAMEs. Lists filter results in an "AND" manner and not "OR". It also looks for NAMEs outside of the hosts subnet in case of tcpip. |
195
+
| DEPTHAI_DEVICE_NAME_LIST | Restricts default search to the specified NAMEs. Accepts comma separated list of NAMEs. Lists filter results in an "AND" manner and not "OR". It also looks for NAMEs outside of the host's subnet in case of tcpip. |
Doxygen is used to generate documentation. Follow [doxygen download](https://www.doxygen.nl/download.html#srcbin) and install the required binaries for your platform.
241
256
242
-
After that specify CMake define `-D'DEPTHAI_BUILD_DOCS=ON`' and build the target `doxygen`
257
+
After that specify CMake define `-D'DEPTHAI_BUILD_DOCS=ON'` and build the target `doxygen`
243
258
244
259
## Debugging tips
245
260
246
261
Debugging can be done using **Visual Studio Code** and either **GDB** or **LLDB** (extension 'CodeLLDB').
247
262
LLDB in some cases was much faster to step with and resolved more `incomplete_type` variables than GDB. Your mileage may vary though.
248
263
249
264
250
-
If there is a need to step into **Hunter** libraries, that can be achieved by removing previous built artifacts
251
-
```
252
-
rm -r ~/.hunter
253
-
```
254
-
255
-
And configuring the project with the following CMake option set to `ON`
256
-
```
257
-
cmake . -D'HUNTER_KEEP_PACKAGE_SOURCES=ON'
258
-
```
259
-
260
-
This retains the libraries source code, so that debugger can step through it (the paths are already set up correctly)
261
-
262
-
263
265
## Troubleshooting
264
266
265
267
### Build fails with missing OpenCV dependency
266
268
267
269
If your build process happen to fail due to OpenCV library not being found, but you have the OpenCV installed, please
268
-
run build with additional `-D'OpenCV_DIR=...`' flag (replacing default Ubuntu path `/usr/lib/x86_64-linux-gnu/cmake/opencv4` with yours)
270
+
run build with additional `-D'OpenCV_DIR=...` flag (replacing default Ubuntu path `/usr/lib/x86_64-linux-gnu/cmake/opencv4` with yours)
Now the build process should correctly discover your OpenCV installation
275
-
276
-
### Hunter
277
-
Hunter is a CMake-only dependency manager for C/C++ projects.
278
-
279
-
If you are stuck with error message which mentions external libraries (subdirectory of `.hunter`) like the following:
280
-
```
281
-
/usr/bin/ld: /home/[user]/.hunter/_Base/062a19a/ccfed35/a84a713/Install/lib/liblzma.a(stream_flags_decoder.c.o): warning: relocation against `lzma_footer_magic' in read-only section `.text'
0 commit comments