LIPS® Developer Documentation
  • WELCOME
    • LIPS® Developer Documentation
    • About 3D Depth Cameras
    • Depth Image
    • Understanding Depth
    • An Ideal Depth Camera
    • LIPSedge™ AE Series Camera Selection Guide
  • LIPSedge™ SDK 1.x
    • LIPSedge™ SDK 1.x
    • Benefits from LIPSedge™ SDK implementation
    • LIPSedge™ SDK 1.x Installation Architecture
    • How to identify each camera SDK
    • New Features for v1.02
      • Installing and identifying packages on Windows
      • Saving Captures and Videos with the DepthViewer
      • Saving Point Cloud with PointCloudViewer
      • Live On-Screen displaying Depth, FPS
      • Live On-Screen displaying XYZ parameters in RawfileViewer
      • Distance measurement on-screen from point-to-point
      • Mouse Pointer Change
      • LIPSedge™ AE and S series Colormap new feature addition
      • Simple naming for LIPSedge™ SDK Tools
      • Importing parameters from .json files for LIPSedge™ AE and S series
    • LIPSedge™ SDK v1.02 Tools
      • DepthViewer
      • PointCloudViewer
      • CameraParameterViewer
      • CameraCenterViewer
      • CameraEventListener
      • CameraPowerTest
      • LensModeSelector
      • LIPSImuReader
      • CameraSimpleViewer
      • RawFileViewer
    • Features Articles
      • LIPSedge™ SDK Persistent Connection for PoE and USB
    • Tutorials
    • Development and Deployment on arm64
  • DOCUMENTS, INSTALLATION & SETUP
    • LIPSedge™ AE400 / AE450
      • User Guide
        • Previous Releases (Archive)
      • SDK Release
        • Previous Releases (Archive)
      • Installation
        • Linux
        • Windows
        • ROS Wrapper
        • NVIDIA ISAAC Wrapper
        • Persistent Connection
      • STEP files for CAD Use
      • Certifications Documents
      • Firmware
    • LIPSedge™ AE430 / AE470
      • User Guide
        • Previous Releases (Archive)
      • SDK Release
        • Previous Releases (Archive)
      • Firmware
      • STEP files for CAD Use
    • LIPSedge™ AE430-DK / AE470-DK
      • User Guide
    • LIPSedge™ DL & M3 Series
      • User Guide
        • Previous Releases (Archive)
      • SDK Release
        • Previous Releases (Archive)
        • Changelog
      • STEP files for CAD Use
      • Installation
        • Ubuntu
        • Windows
    • LIPSedge™ L215u / L210u
      • User Guide
        • Previous Releases (Archive)
      • SDK Release
        • Previous Releases (Archive)
        • Changelog
      • Installation
        • Windows
        • Linux
      • STEP files for CAD Use
    • LIPSedge™ S205p
      • User Guide
        • Previous Releases (Archive)
      • SDK Release
      • STEP files for CAD Use
    • LIPSedge™ F Series - Edge Accelerator
      • User Guide
    • LIPSFace™ HW110/115 On-Device 3D Facial Recognition
      • User Guide & SDK Download
      • STEP files for CAD Use
    • LIPSFace™ HW120/125 On-Device 3D Facial Recognition
      • User Guide
      • SDK
      • STEP files for CAD Use
    • LIPScan 3D ™ Middleware
      • LIPScan 3D™ Desktop
        • Application Download
          • Previous Releases
        • User Guide
        • Release Notes
      • LIPScan 3D™ SDK
        • SDK Download
          • Previous Releases
        • User Guide
        • Release Notes
    • LIPSense™ 3D Body Pose Middleware
      • User Guide & SDK Download
        • Previous Releases (Archive)
      • Changelog
    • LIPSMetric™ HA110 Handheld Dimensioner
      • User Guide
    • LIPSMetric™ ST115 Static Dimensioner
      • User Guide
    • LIPSMetric™ ST130 Pallet Dimensioner
      • User Guide
  • LIPSedge™ SDK Languages & Libraries
    • C++
      • environment-setup
      • hello-lipsedge-sdk
      • opencv-viewer
      • roi
      • depth-data
      • align-depth-color
      • range-filter
      • remove-background
      • record
      • pointcloud
      • config-resolution
      • camera-parameter
    • Python
      • environment-setup
      • hello-lipsedge-sdk
      • opencv-viewer
      • roi
      • depth-data
      • align-depth-color
      • range-filter
      • remove-background
      • record
    • Java
      • ni-hello
    • C#
      • ni-hello
      • simple-read
    • OpenCV
  • LIPSedge™ SDK Frameworks
    • GenICam (for Halcon / Aurora Vision)
      • User Manual
      • Driver(.cti) and Nodemap (.xml)
      • Supported LIPSedge™ Camera SDK
      • Installation Example
    • ROS
    • ROS2
    • NVIDIA Isaac Wrapper
  • LIPSedge™ SDK Sample Codes
    • Sample Applications & Viewer & Utilities
      • ni-viewer
      • ni-pointcloud-gl
      • ni-camera-matrix
  • LIPSFace™ SDK
    • LIPSFace™ SDK Overview
    • Updates
Powered by GitBook
On this page
  • Examples
  • Prerequisite
  • Linux:
  • Windows:
  • Build
  • Linux
  • Windows
  • Expect output
  1. LIPSedge™ SDK Languages & Libraries

C++

Examples

Name
Description

Help you make sure build environment is setup correctly

How to connect to camera and get camera info

Use OpenCV to display Color, depth and IR images

How to set the ROI of image frame

Get the depth value by pixel coordinate (x,y)

Align depth and RGB frame to the same coordinate

Get the data only in desired distance only

Use range filter to filter out the background

Record camera streams for NiViewer playback

Compute pointcloud data and display

Change resolution, FPS and pixel format

Get camera parameters

Prerequisite

Install cmake and opencv.

Linux:

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

Windows:

Installation Guide on Windows

Create two files, example.cpp and CMakeLists.txt with following content.

# CMakeLists.txt
cmake_minimum_required(VERSION 3.3)

project( example CXX )

if(MSVC)
    include_directories("C:/Program Files/OpenNI2/Include")
    link_directories("C:/Program Files/OpenNI2/Lib")
endif()


add_executable( ${PROJECT_NAME} project.cpp )

find_package(OpenCV)

target_link_libraries(${PROJECT_NAME} OpenNI2)
target_link_libraries(${PROJECT_NAME} ${OpenCV_LIBS})
// project_setup.cpp
#include <openni2/OpenNI.h>
#include <opencv2/core/core.hpp>

int main()
{
    auto version = new openni::Version();
    printf("OpenNI Version:%d.%d.%d.%d\n", version->build, version->major, version->minor, version->maintenance);

    printf("OpenCV Version:%s\n", CV_VERSION);
    return 0;
}

Build

Linux

Create a build folder next to CMakeLists.txt. Change directory to build folder. Use cmake to generate build files. Then use make to build.

mkdir build
cd build
cmake ..
make

Windows

1. Open Visual Studio and create a new project

2. Create a new cmake project

3. Modify CMakeLists.txt and project_setup.cpp

Expect output

OpenNI Version:0.0.0.0
OpenCV Version:4.2.0.4.2.0
PreviousLIPSedge™ SDK Languages & LibrariesNextenvironment-setup

Last updated 10 months ago

Install , and (we use VS2019).

cmake
OpenCV
Visual Studio
environment-setup
hello-lipsedge-sdk
opencv-viewer
roi
depth_data
align-depth-color
range-filter
remove-background
record
pointcloud
config-resolution
camera-parameter