Skip to content


Overview of current Luxonis Oak cameras, or which one you should get for your next computer vision application

Microsoft stopped manufacturing the Kinect in 2017. Google stopped manufacturing Project Tango in 2018 in favour of ARCore. Intel started winding down their RealSense cameras in 2021 to focus on their main business. Thankfully, we have Luxonis stepping up and producing the next generation of perceptual cameras for robotics and computer vision applications.

Luxonis offers perceptual cameras for basically three types of applications: visible spectrum inference(VSI), VSI plus passive infrared stereo, and VSI plus active infrared stereo. Let’s see each one in detail. Note: I’m using referral links in this post, so if you buy something I might receive a commission.

Visible spectrum inference (VSI) cameras

These cameras have a single RGB sensor, just like a normal camera, but have the ability to perform optimised neural network inference inside the camera with a specialised chip such as the Myriad X VPU. For example if your application is to detect or classify objects, visual tracking, or anything related to doing inference in the visual spectrum, then this type of cameras should be enough for you. They have the least amount of power consumption, smallest size, and they’re also the cheapest ones.

An example of VSI, the object was classified as a Potted Plant with 99.51% certainty.

For this section the standard camera would be the Oak-1. If you don’t have any special requirements, this should be the one you get. There are some variants that you might want to consider in case you need something special: If you want to have a wider field of view, you can get the Oak-1 W. If you’re looking for higher resolution, then you should get the Oak-1 Max. If you’re on a budget, you can get the OAK-1-Lite Auto-Focus which is basically the same but with a cheaper sensor, and if you’re putting this on a vibrating environment, such as a drone for example, grab the OAK-1-Lite Fixed-Focus.

VSI plus passive infrared stereo cameras

These cameras can do everything that the VSI cameras can do but also come with two additional fast infrared sensors with global shutter that are used to estimate depth through disparity matching inside the camera. The nice thing about this is that your host device can simply use the depth information, all the heavy computation is done inside the camera itself. And of course you can also use those additional infrared sensors however you like, not only for depth estimation, but for example for applications where doing inference in the near-infrared spectrum would be more effective than VSI.

An example of depth estimation using passive infrared stereo. Whiter pixels are closer to the camera.

For this section the standard camera would be the Oak-D S2 Auto-Focus. If you don’t have any special requirements, this should be the one you get. There are some variants that you might want to consider in case you need something special. If you’re planning to use this on a small device like a Raspberry Pi, then you should either get the Oak-D(this was the original camera from the Kickstarter project) as it comes with a built-in barrel jack connector for external power(some devices like the Raspberry Pi cannot deliver the required power over USB only), or buy a separate Y-Adapter for your camera. If you’re putting the camera in a vibrating environment, such as a car for example, then you might want to get the Oak-D S2 Fixed-Focus, although note that this only affects the RGB camera. If you’re on a budget, or want to have a lighter camera by sacrificing some infrared resolution, you can get either the Oak-D Lite Auto-Focus, or the Oak-D Lite Fixed-Focus. Again, the auto or fixed focus only applies to the RGB camera.

VSI plus active infrared stereo cameras

These cameras can do everything that the VSI plus passive infrared stereo cameras can do but also come with an infrared laser dot projector for active stereo and an infrared illumination LED for night vision. This means that you will get a much better depth estimation for uniform areas such as walls for example, as passive stereo relies on matching the features of the scene only, but blank walls have very few distinctive features. By projecting a known pattern in infrared (invisible to the human eye and the RGB camera), the extra features in the infrared frames help the camera to get a better depth estimation in those cases.

Active stereo can produce better depth maps in certain cases. Image by luxonis

Another thing you can do with this camera is to use the infrared illumination LED to be able to “see in the dark” as the RGB camera(or your eyes) would not be able to see anything, but both infrared cameras would be completely illuminated. This is useful for applications that need to do inference in the near-infrared spectrum with no natural light.

When there’s no natural light, the infrared illumination LED makes IR images clear. Image by luxonis

For this section the standard camera would be the Oak-D Pro Auto-Focus. If you don’t have any special requirements, this should be the one you get. There are some variants that you might want to consider in case you need something special. If you’re planning to use the camera in a vibrating environment (such as a car for example), then you might want to grab the Oak-D Pro Fixed-Focus (note that the fixed focus only applies to the RGB camera). If you’re interested in a wider field of view, then you should get the Oak-D-Pro Wide.

Industrial usage

Finally, if you’re going to use these cameras in industrial applications, Luxonis offers them in a more ruggedised version and with a Power over Ethernet (PoE) connection. The features of the cameras are otherwise the same as already discussed. You can check the industrial version of these cameras here.

Conclusion

And that’s it, you should now be able to decide which Oak camera is best for your particular application. If you want some help starting out with the installation of the software, check out this post.

Enjoyed the article?

Posted in Computer Vision, IoT, Open Source, OpenCV.


How to use the Oak-D spatial camera C++ interface with OpenCV in Ubuntu 22.04 LTS

The Luxonis Oak-D(affiliate link) is a great infrared stereo camera. It also comes with an RGB camera, and the Intel Movidius MyriadX chip to perform neural inference inside the device. They’ve named it a “spatial camera” because of all these features. It’s quite a bargain for its price, and it’s also quite compact, so it’s perfect for robotic and computer vision applications in general. If you don’t have one of these cameras and would like to get one, check out this blog post.

The Oak-D camera. It has two IR cameras and one RGB camera. It has a USB-C connector, and an extra power connector in case the host cannot provide enough power.

In this post I’ll show you how to start using it in Ubuntu to make your own computer vision applications with OpenCV. First, let’s make sure you have an updated system:

sudo apt-get update
sudo apt-get upgrade

Now let’s get some dependencies that are needed to build the Oak-D library and the examples:

sudo apt-get install cmake build-essential git libopencv-dev

Now we’re ready to grab the source code, compile it, and install it:

cd ~
mkdir oakd
cd oakd
wget https://github.com/luxonis/depthai-core/releases/download/v2.20.2/depthai-core-v2.20.2.tar.gz
tar -xzvf depthai-core-v2.20.2.tar.gz
cd depthai-core-v2.20.2/
mkdir build
cd build
cmake -D BUILD_SHARED_LIBS=OFF -D DEPTHAI_BUILD_EXAMPLES=ON -D DEPTHAI_OPENCV_SUPPORT=ON -DCMAKE_INSTALL_PREFIX=/usr/local ..
make -j10
sudo make install

Now the camera library is installed, but it is only accessible using sudo, so let’s set the udev rules to allow normal users to access it(make sure to disconnect the camera now):

echo 'SUBSYSTEM=="usb", ATTRS{idVendor}=="03e7", MODE="0666"' | sudo tee /etc/udev/rules.d/80-movidius.rules
sudo udevadm control --reload-rules && sudo udevadm trigger

And now connect the camera again, the new rules should apply, and a normal user should be able to access it. Try running some of the demos(you can press q to exit):

cd ~/oakd/depthai-core-v2.20.2/build/examples
./depth_preview
./rgb_preview
Depth frame obtained from the camera. Whiter pixels mean they are closer to the camera.

In the depth preview you’ll see gray scale pixels representing depth. The closer the pixel is to the camera, the higher value(whiter) it would be. The RGB preview simply shows the RGB camera. Make sure to explore the rest of the examples to see the capabilities of the camera.

The simplest way to build your own application is to copy one example and use it as the starting point, using the same building pipeline. For example, let’s write an app that gets the depth data like the depth_preview example:

cd ~/oakd/depthai-core-v2.20.2/examples
mkdir myapp
cd myapp
cp ../StereoDepth/depth_preview.cpp main.cpp

We now have a main.cpp file with the code for our application. Make a tiny change to the code so that you know it’s a different file, open main.cpp and make this change:

//cv::imshow("disparity", frame)
cv::imshow("mydisparity", frame)

Now let’s add our application to the building pipeline, alongside the other examples. Edit this file:

nano ~/oakd/depthai-core-v2.20.2/examples/CMakeLists.txt

At the end of the file, simply write this one line and save the file:

dai_add_example(my_oak_app myapp/main.cpp ON)

my_oak_app is the name of your executable, and myapp/main.cpp is where the source code is. Let’s build it and run it:

cd ~/oakd/depthai-core-v2.20.2/build/
make
cd examples
./my_oak_app

You should now see the same depth_preview application but the window name should be “mydisparity” instead.

Same application as depth_preview but now we have full control of the source code.

That’s it, remember to explore the other examples, and also check out the Luxonis C++ API Reference to see all that you can do with these incredible cameras.

Enjoyed the tutorial?

Posted in Computer Vision, IoT, Open Source, OpenCV, Photography, Programming.