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
    • 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™ SDK
        • SDK Download
          • Previous Releases
        • User Guide
        • Release Notes
    • 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
    • Flutter
  • 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
  • Overview
  • Expect Output
  • Prerequisite
  • Tutorial
  • Full code
  1. LIPSedge™ SDK Languages & Libraries
  2. C++

config-resolution

PreviouspointcloudNextcamera-parameter

Last updated 8 months ago

Overview

In LIPSEdge SDK, we use video mode to set different resolution, FPS and data format. This example shows you how to use video mode settings.

Expect Output

Prerequisite

Tutorial

We first get all available video modes of each stream by the following code. Video mode include resolution, FPS and pixel format information.

const openni::SensorInfo *colorInfo = device.getSensorInfo(SENSOR_COLOR);
const openni::SensorInfo *depthInfo = device.getSensorInfo(SENSOR_DEPTH);
const openni::SensorInfo *irInfo = device.getSensorInfo(SENSOR_IR);

auto &colorVideoModes = colorInfo->getSupportedVideoModes();
auto &depthVideoModes = depthInfo->getSupportedVideoModes();
auto &irVideoModes = irInfo->getSupportedVideoModes();

Then we print out all of them. Pixel format store as integer number. We use pixelFormatToString to convert them to string.

std::string pixelFormatToString(PixelFormat format)
{
    switch (format)
    {
    // Depth
    case PIXEL_FORMAT_DEPTH_100_UM:
        return "Depth-16bit,0.1mm";
        break;
    case PIXEL_FORMAT_DEPTH_1_MM:
        return "Depth-16bit,1mm";
        break;

        ...
    }
}

We ask user to enter number to select the desired video mode

std::string input;
int colorSelection = 0, depthSelection = 0, irSelection = 0;

std::cout << "Select Color video mode:";
std::cin >> input;
colorSelection = atoi(input.c_str());

std::cout << "Select Depth video mode:";
std::cin >> input;
depthSelection = atoi(input.c_str());

std::cout << "Select Ir video mode:";
std::cin >> input;
irSelection = atoi(input.c_str());

Before starting streams, we set the video mode first

VideoStream color;
color.create(device, SENSOR_COLOR);
color.setVideoMode(colorVideoModes[colorSelection]);
color.start();

VideoStream depth;
depth.create(device, SENSOR_DEPTH);
depth.setVideoMode(depthVideoModes[depthSelection]);
depth.start();

VideoStream ir;
ir.create(device, SENSOR_IR);
ir.setVideoMode(irVideoModes[irSelection]);
ir.start();

We can get current video mode from stream object to check video mode has been set.

VideoMode colorMode = color.getVideoMode();
VideoMode depthMode = depth.getVideoMode();
VideoMode irMode = ir.getVideoMode();

Full code

OpenCV Viewer
config-resolution.cpp