Skip to content

Commit

Permalink
Merge pull request #261 from luxonis/develop
Browse files Browse the repository at this point in the history
Release v2.12.0
  • Loading branch information
SzabolcsGergely committed Nov 13, 2021
2 parents c1b697a + 5a5b2f0 commit 2657938
Show file tree
Hide file tree
Showing 11 changed files with 89 additions and 24 deletions.
25 changes: 19 additions & 6 deletions .github/workflows/main.workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,24 +65,31 @@ jobs:
strategy:
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
cmake: ['3.10.x', ''] # Older version (Ubuntu 18.04) and newest

steps:
- name: Cache .hunter folder
if: matrix.os != 'windows-latest'
uses: actions/cache@v2
with:
path: ~/.hunter/
key: hunter-${{ matrix.os }}
key: hunter-${{ matrix.os }}-${{ matrix.cmake }}
- name: Cache .hunter folder
if: matrix.os == 'windows-latest'
uses: actions/cache@v2
with:
path: C:/.hunter/
key: hunter-${{ matrix.os }}
key: hunter-${{ matrix.os }}-${{ matrix.cmake }}

- uses: actions/checkout@v2
with:
submodules: 'recursive'

- name: Setup cmake
uses: jwlawson/actions-setup-cmake@v1.9
with:
cmake-version: ${{ matrix.cmake }}

- name: Install dependencies
if: matrix.os == 'macos-latest'
run: |
Expand All @@ -102,11 +109,17 @@ jobs:
echo "OpenCV_DIR=C:\tools\opencv\build" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "C:\tools\opencv\build\x64\vc15\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: configure
run: cmake -S . -B build -D DEPTHAI_BUILD_EXAMPLES=ON -D DEPTHAI_BUILD_TESTS=ON
- name: Build (old CMake, gcc/Clang)
if: matrix.cmake == '3.10.x' && matrix.os != 'windows-latest'
run: |
cmake -H. -Bbuild -D'DEPTHAI_BUILD_EXAMPLES=ON' -D'DEPTHAI_BUILD_TESTS=ON'
cmake --build build -- -j8
- name: build
run: cmake --build build --parallel 8
- name: Build (newest CMake)
if: matrix.cmake != '3.10.x'
run: |
cmake -S . -B build -D DEPTHAI_BUILD_EXAMPLES=ON -D DEPTHAI_BUILD_TESTS=ON
cmake --build build --parallel 8
integration:
runs-on: ${{ matrix.os }}
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ if(WIN32)
endif()

# Create depthai project
project(depthai VERSION "2.11.1" LANGUAGES CXX C)
project(depthai VERSION "2.12.0" LANGUAGES CXX C)
get_directory_property(has_parent PARENT_DIRECTORY)
if(has_parent)
set(DEPTHAI_VERSION ${PROJECT_VERSION} PARENT_SCOPE)
Expand Down
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Documentation is available over at [Luxonis DepthAI API](https://docs.luxonis.co
DepthAI library doesn't yet provide API stability guarantees. While we take care to properly deprecate old functions, some changes might still be breaking. We expect to provide API stability from version 3.0.0 onwards.

## Dependencies
- cmake >= 3.4
- CMake >= 3.10
- libusb1 development package (MacOS & Linux only)
- C/C++14 compiler
- [optional] OpenCV 4 (required if building examples)
Expand Down Expand Up @@ -44,15 +44,15 @@ For older versions use: Linux/macOS: `cmake --build build -- -j[num CPU cores]`,

To build dynamic version of library configure with following option added
```
cmake -S. -Bbuild -D BUILD_SHARED_LIBS=ON
cmake -S. -Bbuild -D'BUILD_SHARED_LIBS=ON'
cmake --build build
```

## Running examples

To build the examples configure with following option added
```
cmake -S. -Bbuild -D DEPTHAI_BUILD_EXAMPLES=ON
cmake -S. -Bbuild -D'DEPTHAI_BUILD_EXAMPLES=ON'
cmake --build build
```

Expand Down Expand Up @@ -87,11 +87,11 @@ target_link_libraries([my-app] PRIVATE depthai::opencv)

And point CMake to either build directory or install directory:
```
-D depthai_DIR=depthai-core/build
-D'depthai_DIR=depthai-core/build'
```
or
```
-D depthai_DIR=depthai-core/build/install/lib/cmake/depthai
-D'depthai_DIR=depthai-core/build/install/lib/cmake/depthai'
```

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.
Expand Down Expand Up @@ -136,7 +136,7 @@ The generated integration file also specifies include paths without requiring in

To install specify optional prefix and build target install
```
cmake -S. -Bbuild -D CMAKE_INSTALL_PREFIX=[path/to/install/dir]
cmake -S. -Bbuild -D'CMAKE_INSTALL_PREFIX=[path/to/install/dir]'
cmake --build build --target install
```

Expand All @@ -147,7 +147,7 @@ If `CMAKE_INSTALL_PREFIX` isn't specified, the library is installed under build

To run the tests build the library with the following options
```
cmake -S. -Bbuild -D DEPTHAI_TEST_EXAMPLES=ON -D DEPTHAI_BUILD_TESTS=ON -D DEPTHAI_BUILD_EXAMPLES=ON
cmake -S. -Bbuild -D'DEPTHAI_TEST_EXAMPLES=ON' -D'DEPTHAI_BUILD_TESTS=ON' -D'DEPTHAI_BUILD_EXAMPLES=ON'
cmake --build build
```

Expand Down Expand Up @@ -176,7 +176,7 @@ cmake --build build --target clangformat

Doxygen is used to generate documentation. Follow [doxygen download](https://www.doxygen.nl/download.html#srcbin) and install the required binaries for your platform.

After that specify CMake define `-D DEPTHAI_BUILD_DOCS=ON` and build the target `doxygen`
After that specify CMake define `-D'DEPTHAI_BUILD_DOCS=ON`' and build the target `doxygen`

## Debugging tips

Expand All @@ -191,7 +191,7 @@ rm -r ~/.hunter

And configuring the project with the following CMake option set to `ON`
```
cmake . -D HUNTER_KEEP_PACKAGE_SOURCES=ON
cmake . -D'HUNTER_KEEP_PACKAGE_SOURCES=ON'
```

This retains the libraries source code, so that debugger can step through it (the paths are already set up correctly)
Expand All @@ -202,10 +202,10 @@ This retains the libraries source code, so that debugger can step through it (th
### Build fails with missing OpenCV dependency

If your build process happen to fail due to OpenCV library not being found, but you have the OpenCV installed, please
run build with additional `-D OpenCV_DIR` flag (replacing default Ubuntu path `/usr/lib/x86_64-linux-gnu/cmake/opencv4` with yours)
run build with additional `-D'OpenCV_DIR=...`' flag (replacing default Ubuntu path `/usr/lib/x86_64-linux-gnu/cmake/opencv4` with yours)

```
cmake -S. -Bbuild -D OpenCV_DIR=/usr/lib/x86_64-linux-gnu/cmake/opencv4
cmake -S. -Bbuild -D'OpenCV_DIR=/usr/lib/x86_64-linux-gnu/cmake/opencv4'
```

Now the build process should correctly discover your OpenCV installation
Expand Down
2 changes: 1 addition & 1 deletion cmake/Depthai/DepthaiDeviceSideConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
set(DEPTHAI_DEVICE_SIDE_MATURITY "snapshot")

# "full commit hash of device side binary"
set(DEPTHAI_DEVICE_SIDE_COMMIT "2021725697c9b570383b0597951a9d7b162e6182")
set(DEPTHAI_DEVICE_SIDE_COMMIT "3bb469fa08b7b0abc4353cd27219521dfd763a9d")

# "version if applicable"
set(DEPTHAI_DEVICE_SIDE_VERSION "")
17 changes: 17 additions & 0 deletions cmake/Hunter/config.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ hunter_config(
CMAKE_ARGS
SPDLOG_BUILD_EXAMPLE=OFF
SPDLOG_FMT_EXTERNAL=OFF
CMAKE_CXX_VISIBILITY_PRESET=hidden
CMAKE_C_VISIBILITY_PRESET=hidden
)

# libarchive, luxonis fork
Expand Down Expand Up @@ -84,4 +86,19 @@ hunter_config(
SHA1 "4ecb711eabfd15bc88ff9dd9342907fc5da46b62"
CMAKE_ARGS
BACKWARD_TESTS=OFF
)

hunter_config(
Catch2
VERSION "2.13.7"
URL "https://github.com/catchorg/Catch2/archive/refs/tags/v2.13.7.tar.gz"
SHA1 "fa8f14ccf852413d3c6d3999145ada934d37d773"
)

# ZLib - Luxonis fix for alias on imported target for old CMake versions
hunter_config(
ZLIB
VERSION "1.2.11-p2"
URL "https://github.com/luxonis/zlib/archive/refs/tags/v1.2.11-p2.tar.gz"
SHA1 "fb8b6486183b13a86040f793a939b128f6d27095"
)
6 changes: 6 additions & 0 deletions include/depthai/pipeline/datatype/StereoDepthConfig.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,12 @@ class StereoDepthConfig : public Buffer {
*/
void setLeftRightCheck(bool enable);

/**
* Disparity range increased from 95 to 190, combined from full resolution and downscaled images.
* Suitable for short range objects
*/
void setExtendedDisparity(bool enable);

/**
* Computes disparity with sub-pixel interpolation (5 fractional bits).
*
Expand Down
12 changes: 12 additions & 0 deletions include/depthai/pipeline/node/StereoDepth.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,18 @@ class StereoDepth : public Node {
*/
Output debugDispLrCheckIt2{*this, "debugDispLrCheckIt2", Output::Type::MSender, {{DatatypeEnum::ImgFrame, false}}};

/**
* Outputs ImgFrame message that carries extended left-right check first iteration (downscaled frame, before combining with second iteration) disparity map.
* Useful for debugging/fine tuning.
*/
Output debugExtDispLrCheckIt1{*this, "debugExtDispLrCheckIt1", Output::Type::MSender, {{DatatypeEnum::ImgFrame, false}}};

/**
* Outputs ImgFrame message that carries extended left-right check second iteration (downscaled frame, before combining with first iteration) disparity map.
* Useful for debugging/fine tuning.
*/
Output debugExtDispLrCheckIt2{*this, "debugExtDispLrCheckIt2", Output::Type::MSender, {{DatatypeEnum::ImgFrame, false}}};

/**
* Outputs ImgFrame message that carries cost dump of disparity map.
* Useful for debugging/fine tuning.
Expand Down
6 changes: 5 additions & 1 deletion src/pipeline/datatype/StereoDepthConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ void StereoDepthConfig::setLeftRightCheck(bool enable) {
cfg.algorithmControl.enableLeftRightCheck = enable;
}

void StereoDepthConfig::setExtendedDisparity(bool enable) {
cfg.algorithmControl.enableExtended = enable;
}

void StereoDepthConfig::setSubpixel(bool enable) {
cfg.algorithmControl.enableSubpixel = enable;
}
Expand All @@ -56,7 +60,7 @@ float StereoDepthConfig::getMaxDisparity() const {
maxDisp = 63;
}
if(cfg.costMatching.enableCompanding) maxDisp = 175;
if(false) maxDisp *= 2; // TODO re-enable with extended
if(cfg.algorithmControl.enableExtended) maxDisp *= 2;
if(cfg.algorithmControl.enableSubpixel) maxDisp *= (1 << cfg.algorithmControl.subpixelFractionalBits);
return maxDisp;
}
Expand Down
17 changes: 15 additions & 2 deletions src/pipeline/node/StereoDepth.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,19 @@ StereoDepth::StereoDepth(const std::shared_ptr<PipelineImpl>& par, int64_t nodeI
: Node(par, nodeId), rawConfig(std::make_shared<RawStereoDepthConfig>()), initialConfig(rawConfig) {
// 'properties' defaults already set
inputs = {&inputConfig, &left, &right};
outputs = {&depth, &disparity, &syncedLeft, &syncedRight, &rectifiedLeft, &rectifiedRight};
outputs = {&depth,
&disparity,
&syncedLeft,
&syncedRight,
&rectifiedLeft,
&rectifiedRight,
&outConfig,
&debugDispLrCheckIt1,
&debugDispLrCheckIt2,
&debugExtDispLrCheckIt1,
&debugExtDispLrCheckIt2,
&debugDispCostDump,
&confidenceMap};
}

std::string StereoDepth::getName() const {
Expand Down Expand Up @@ -128,7 +140,8 @@ void StereoDepth::setSubpixel(bool enable) {
properties.initialConfig = *rawConfig;
}
void StereoDepth::setExtendedDisparity(bool enable) {
properties.enableExtendedDisparity = enable;
initialConfig.setExtendedDisparity(enable);
properties.initialConfig = *rawConfig;
}
void StereoDepth::setRectifyEdgeFillColor(int color) {
properties.rectifyEdgeFillColor = color;
Expand Down
2 changes: 1 addition & 1 deletion tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ include(CTest)
enable_testing()

# Add catch2 for writing tests
hunter_add_package(Catch)
hunter_add_package(Catch2)
find_package(Catch2 CONFIG REQUIRED)

# Macro for adding new tests
Expand Down

0 comments on commit 2657938

Please sign in to comment.