Develop your first TaraXL disparity App – in 5 minutes

See3Cam_StereoA and SteereoCAM® is e-con’s new stereo camera with acceleration support for Jetson boards(Xavier/TX2/Nano). It is primarily targeted for depth applications and provides good accuracy. For perfomance related data, please refer this page. TaraXL SDK is bundled with the TaraXL development kit. The TaraXL SDK supports Nvidia’s TX2,Xavier, Nano boards and x86(Ubuntu 18.04) linux platform. This article explains how to develop your first program to get a disparity map.

This article assumes that you have a TX2 board and have installed the TaraXL SDK.

On the TX2, you can create a new “sample.cpp” file and copy the following code into it.

#include
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>#include “TaraXL.h”
#include “TaraXLCam.h”
#include “TaraXLDepth.h”using namespace std;
using namespace cv;
using namespace TaraXLSDK;int main () {//logic :-
//enumerate devices
//connect to a device
//set the disparity mode – high frame rate(low accuracy) or low frame rate(high accuracy)
//get disparity map
//store the disparity map to a fileTaraXL taraxl;
TaraXLCam selectedCam;
TaraXLCamList taraxlCamList;
TaraXLDepth *taraxlDepth;taraxl.enumerateDevices(taraxlCamList);
selectedCam = taraxlCamList.at(0);selectedCam.connect();
taraxlDepth = new TaraXLDepth(selectedCam);
taraxlDepth->setAccuracy(HIGH);Mat left, right, grayDisp, depthMap;
taraxlDepth->getMap(left, right, grayDisp, true, depthMap, false);imwrite(“../left.jpg”, left);
imwrite(“../right.jpg”, right);
imwrite(“../grayDisp.jpg”, grayDisp);cout << “Images saved to the disk!!!!” << endl;
}

Instructions to compile:

nvidia@tegra-ubuntu:~$ g++ sample.cpp -I /usr/local/taraxl-sdk/include/ -L /usr/local/taraxl-opencv/lib -lopencv_core -lopencv_highgui -lopencv_imgproc -lopencv_imgcodecs -L /usr/local/taraxl-sdk/lib -lecon_taraxl

nvidia@tegra-ubuntu:~$ ./a.out
Images saved to the disk!!!!

nvidia@tegra-ubuntu:~$ ls ..
grayDisp.jpg left.jpg right.jpg

Output images are shown below (left, right, disparity):

Please write to camerasolutions@e-consystems.com for further details and to get immediate support.

 

Related posts

How to achieve a high frame rate of up to 1164 fps using e-CAM56_CUOAGX’s Multi-ROI Feature

NDAA compliance and e-con Systems’ cameras

e-con Systems Launches 5MP Global Shutter Camera with Multi-ROI for Zero Blur Motion Capture