Skip to content

Latest commit

 

History

History
76 lines (57 loc) · 1.17 KB

ReadMe.md

File metadata and controls

76 lines (57 loc) · 1.17 KB

OakD Library

Install DepthAI-Core C++ Library

git submodule init
git submodule update --recursive
mkdir Libraries/depthai-core/Build
cd Libraries/depthai-core/Build
cmake ..
make # optionally: make -j NUM_PROCESSORS_YOU_HAVE
sudo make install

Compile The OakD Library

mkdir Build
cd Build
cmake ..
make # optionally: make -j NUM_PROCESSORS_YOU_HAVE

Include The OakD Library In A CMake Project

cmake_minimum_required(VERSION 3.4)
# Add the OakD library as a CMake subdirectory.
add_subdirectory(PATH_TO/OakD)
project(PROJECT_NAME)

...

add_executable(PROJECT_EXE ...)
# Link OakD to your project.
target_link_libraries(PROJECT_EXE PUBLIC OakD)

Use The OakD Library To Stream RGB Video And Depth Frames

#include "OakD.hpp"

int main()
{
    OakD oakCam;
    oakCam.Connect();
    oakCam.StartStream();
}

Other Functionality

#include "OakD.hpp"

int main()
{
    OakD oakCam;
    bool connected = oakCam.Connect();
    if (connected)
    {
        cv::Mat rgbImage = oakCam.GetImage();
        cv::Mat depthImage = oakCam.GetStereoImage();
    }
    else
    {
        // Failed to connect.
    }
}