Internal - LIPS Developer Documentation
  • WELCOME
    • LIPS® Developer Documentation
  • INSTALLATION & SETUP
    • LIPSedge™ AE400 / AE450
      • SDK Release
        • Firmware
        • SDK
        • User Guide
      • Installation
        • Linux
        • Windows
        • ROS Wrapper
        • NVIDIA ISAAC Wrapper
    • LIPSedge™ AE430 / AE470
      • Installation
        • Linux
        • Windows
    • LIPSedge™ DL & M3 Series
      • SDK Release
      • Installation
        • Ubuntu
        • Windows
    • LIPSFace™ HW110/115 On-Device 3D Facial Recognition
      • User Guide & SDK Download
    • LIPSFace™ HW120/125 On-Device 3D Facial Recognition
    • LIPSMetric™ HA110 Handheld Dimensioner
      • User Guide
    • LIPSMetric™ ST115 Static Dimensioner
      • User Manual
  • SDK CODE SAMPLES AND LANGUAGES WRAPPERS
    • LIPSedge™ SDK
      • Sample Applications & Viewer & Utilities
      • C++
        • ni-hello
        • ni-simple-read
      • Python
        • ni-hello
        • ni-simple-read
      • Java
        • ni-hello
      • C#
      • OpenCV
      • ROS
    • LIPSFace™ SDK
      • LIPSFace™ SDK Overview
      • LIPSFace™ SDK Developer Guide
Powered by GitBook
On this page
  • Overview
  • Full code
  1. SDK CODE SAMPLES AND LANGUAGES WRAPPERS
  2. LIPSedge™ SDK
  3. Python

ni-hello

Overview

This example shows how to connect to camera and get device info.

  • Import openni package

from openni import openni2
  • Initialize SDK and specify OpenNI Redist folder.

openni2.initialize('/path/to/Openni SDK/Redist')
  • Scan connected devices

uris = openni2.Device.enumerate_uris()
print(uris) # [b'USB#VID_2DF2&PID_0213&REV_0007&BUS_02&ADR_06']
  • Connect to camera and get camera device info

    Or you can use openni2.Device.open_any() to connect to the first found device.

dev = openni2.Device.open_file(uris[0])
deviceInfo = dev.get_device_info()
print(f'Name: {deviceInfo.name}')
print(f'Uri: {deviceInfo.uri}')
print(f'USB Product ID: {deviceInfo.usbProductId}')
print(f'USB Vendor ID: {deviceInfo.usbVendorId}')
print(f'Vendor: {deviceInfo.vendor}')
  • Output

Name: b'TS800'
Uri: b'USB#VID_2DF2&PID_0213&REV_0007&BUS_02&ADR_0C'
USB Product ID: 531
USB Vendor ID: 11762
Vendor: b'LIPS'
  • Close camera and deconstruct OpenNI SDK

dev.close()
openni2.unload()

Full code

PreviousPythonNextni-simple-read

Last updated 2 years ago

ni-hello.py