Skip to content
No results
Purple hexagonal logo with white diamond-shaped center featuring geometric star pattern design suitable for corporate branding and digital applications
LIPS®Developer
Documentation
Back To LIPS
Purple hexagonal logo with white diamond-shaped center featuring geometric star pattern design suitable for corporate branding and digital applications
LIPS®Developer
Documentation
Back To LIPS

Quick Introduction

4
  • LIPS® Documentation Overview
  • 3D Depth Camera Tech Overview
  • Understanding Depth
  • Frequently Asked Questions

LIPSedge Documents

52
  • LIPSedge™ AE400 / AE450
    • Overview
    • LIPSedge™ AE400 / AE450 User Guide
      • User Guide
      • User Manual Archive
    • LIPSedge™ AE400 / AE450 SDK Release
      • SDK Downloads
      • SDK Archive
    • LIPSedge™ AE400 / AE450 Installation
      • Installation
      • Linux Installation
      • Windows Installation
      • ROS Wrapper
      • NVIDIA Isaac SDK Wrapper
      • Persistent Connection
    • LIPSedge™ AE400 / AE450 Complementary Documents
      • Certifications Documents
      • STEP files and 2D CAD drawings
      • Firmware downloads and changelog
  • LIPSedge™ AE430 / AE470
    • Overview
    • LIPSedge™ AE430 / AE470 User Guide
      • User Guide
      • Previous Releases (Archive)
    • LIPSedge™ AE430 / AE470 SDK Release
      • SDK Release
      • Previous Releases (Archive)
    • LIPSedge™ AE430 / AE470 Supplementary Documents
      • Firmware
      • STEP files for CAD Use
  • LIPSedge™ DL & M3 Series
    • Overview
    • LIPSedge™ DL & M3 Series User Guide
      • User Guide
      • Previous Releases (Archive)
    • LIPSedge™ DL & M3 Series SDK Release
      • SDK Release
      • Changelog
      • Previous Releases (Archive)
    • LIPSedge™ DL & M3 Series Installation
      • Installation
      • Ubuntu
      • Windows
    • LIPSedge™ DL & M3 Supplementary Documents
      • STEP files for CAD Use
  • LIPSedge™ L210u / L215u
    • Overview
    • LIPSedge™ L210u / L215u User Guide
      • User Guide
      • Previous Releases (Archive)
    • LIPSedge™ L210u / L215u SDK Release
      • SDK Release
      • Changelog
      • Previous Releases (Archive)
    • LIPSedge™ L210u / L215u Installation
      • Installation
      • Linux
      • Windows
    • LIPSedge™ L215u / L210u Supplementary Documents
      • STEP files for CAD Use
  • LIPSedge™ L235
    •  LIPSedge™ L235 User’s Manual
    • LIPSedge™ L235 SDK Release
  • LIPSedge™ S Series
    • Overview
    • LIPSedge™ S Series User Guide
      • User Guide
    • LIPSedge™ S Series SDK Release
      • SDK Release
    • LIPSedge™ S Series Installation
      • Windows
  • LIPSedge™ AE430-DK / AE470-DK
    • Overview
    • User Guide
  • LIPSedge™ T225 / T235
    • Overview
    • LIPSedge™ T225 / T235 User’s Manual
    • Previous Releases (Archive)

LIPSedge™ SDK 1.x

70
  • Introduction to 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
  • Tutorial and deployment
    • Tutorials
    • Development and Deployment on arm64
  • Features Articles
    • Features Articles
    • LIPSedge™ SDK Persistent Connection for PoE and USB
  • LIPSedge™ SDK Frameworks
    • LIPSedge™ SDK Frameworks
    • ROS
    • ROS2
    • NVIDIA Isaac Wrapper
    • GenICam (for Halcon / Aurora Vision)
      • GenICam (for Halcon / Aurora Vision)
      • User Manual
      • Driver(.cti) and Nodemap (.xml)
      • Supported LIPSedge™ Camera SDK
      • Installation Example
  • LIPSedge™ SDK Tools
    • LIPSedge™ SDK Tools
    • DepthViewer
    • PointCloudViewer
    • CameraParameterViewer
    • CameraCenterViewer
    • CameraEventListener
    • CameraPowerTest
    • LensModeSelector
    • LIPSImuReader
    • CameraSimpleViewer
    • RawFileViewer
  • LIPSedge™ SDK Languages & Libraries
    • LIPSedge™ SDK Languages & Libraries
    • OpenCV
    • C++
      • C++
      • environment-setup
      • hello-lipsedge-sdk
      • opencv-viewer
      • roi
      • depth-data
      • align-depth-color
      • range-filter
      • remove-background
      • record
      • pointcloud
      • config-resolution
      • camera-parameter
      • align
      • distance
      • grabcuts
      • measure
      • motion
      • post-processing
      • save-to-disk
      • sensor-control
    • Python
      • Python
      • environment-setup
      • hello-lipsedge-sdk
      • opencv-viewer
      • roi
      • depth-data
      • align-depth-color
      • range-filter
      • remove-background
      • record
    • Java
      • Java
      • ni-hello
    • C#
      • C#
      • ni-hello
      • simple-read
  • LIPSedge™ SDK Sample Codes
    • LIPSedge™ SDK Sample Codes
    • ni-camera-matrix
    • ni-pointcloud-gl
    • ni-viewer

LIPSense Documents

34
  • LIPSense™ 3D Body Pose Middleware
    • Overview
    • User Manual & SDK Download
    • License Management
    • Changelog
    • Previous Releases (Archive)
    • Examples
      • Python
        • Python
        • python_example
      • C++
        • C++
        • skeleton_example
        • skeleton_opencv
      • c#
        • C#
        • SkeletonCSharp
      • Unity
        • Unity
  • LIPScan 3D ™ Middleware
    • Overview
    • LIPScan 3D™ Desktop
      • Overview
      • User’s Manual
      • Application Download
      • Release Notes
      • Previous Releases
    • LIPScan 3D™ SDK
      • Overview
      • User’s Manual
      • SDK Download
      • Release Notes
      • Previous Releases
  • LIPSFace™ SDK
    • Overview
    • LIPSFace Overview
    • Changelog
  • LIPSFace™ HW120/125 On-Device 3D Facial Recognition
    • Overview
    • User Guide
    • SDK Download
    • STEP files for CAD Use
  • LIPSFace™ HW110/115 On-Device 3D Facial Recognition
    • Overview
    • User Guide & SDK Download
    • STEP files for CAD Use

LIPSMetric Documents

8
  • LIPSMetric™ ST115 Static Dimensioner
    • Overview
    • User’s Manual
  • LIPSMetric™ ST130 Pallet Dimensioner
    • Overview
    • User Guide
  • LIPSMetric™ HA110 Handheld Dimensioner
    • Overview
    • User’s Manual
  • LIPSMetric™ VD115 Vehicle Dimensioner
    • Overview
    • User Manual

LIPSMetric™ Measure Master

9
  • Overview
  • LIPSMetric™ HA110-M
    • User’s Manual
    • SDK Release
  • LIPSMetric™ HA115a
    • SDK Release
    • User’s Manual
  • LIPSMetric™ ST110d
    • User’s Manual
    • SDK Release
  • LIPSMetric™ ST115b
    • User’s Manual
    • SDK Release

LIPSolution Documents

5
  • LIPSAMR Perception Development Kit
    • LIPSAMR Perception Development Kit (PDK1)
      • Overview
    • LIPSAMR Perception Development Kit (PDK4)
      • Overview
      • NVBLOX Sample Build
      • LIPSAMR Perception Development Kit (PDK4) APP Guide
      • LIPSAMR Perception Development Kit (PDK4) SDK Guide

Other LIPS Documents

1
  • LIPS License Management
    • Software License Management
View Categories
  • Home
  • LIPS® Developer Documentation
  • LIPSedge™ SDK 1.x
  • LIPSedge™ SDK Languages & Libraries
  • C++
  • remove-background

remove-background

0:00 / 1:36
  • View as Markdown Open this page as plain Markdown (opens in a new tab)
  • Open in ChatGPT Ask questions about this page (opens in a new tab)
  • Open in Claude Ask questions about this page (opens in a new tab)
  • Open in Google AI Studio Ask questions about this page (Google account required) (opens in a new tab)
  • Open in Perplexity Ask questions about this page (opens in a new tab)
  • Open in Grok Ask questions about this page (opens in a new tab)

Overview #

This example shows you how to remove the background of an image using depth camera with range filter.

Expect Output #

rbg1 | LIPS® Developer Documentation

Prerequisite #

  • OpenCV Viewer
  • Align Depth & Color
  • Range Filter

Tutorial #

Modify from range-filter, we add two variables to determinate the desired distance. Then add two keyboard shortcut to set these values.

double thresholdValueUp = 530;
double thresholdValueDown = 385;
char input;

input = cv::waitKey(1);
if (input == 'p')
{
    if (thresholdValueUp + 5 <= 2000)
        thresholdValueUp += 5;
    else
        thresholdValueUp = 2000;

    std::cout << "Threshold Value (Up):" << thresholdValueUp << " (Down):" << thresholdValueDown << std::endl;
}
else if (input == 'o')
{
    if (thresholdValueUp - 5 >= 0 && thresholdValueUp - 5 >= thresholdValueDown)
        thresholdValueUp -= 5;

    std::cout << "Threshold Value (Up):" << thresholdValueUp << " (Down):" << thresholdValueDown << std::endl;
}
else if (input == 'x')
{
    if (thresholdValueDown + 5 <= 2000 && thresholdValueDown + 5 <= thresholdValueUp)
        thresholdValueDown += 5;

    std::cout << "Threshold Value (Up):" << thresholdValueUp << " (Down):" << thresholdValueDown << std::endl;
}
else if (input == 'z')
{
    if (thresholdValueDown - 5 >= 0)
        thresholdValueDown -= 5;
    else
        thresholdValueDown = 0;

    std::cout << "Threshold Value (Up):" << thresholdValueUp << " (Down):" << thresholdValueDown << std::endl;
}

Using these two values to create range filter mask image like we did before.

cv::threshold(thres, thres, thresholdValueDown, 1024, cv::THRESH_TOZERO);
cv::threshold(thres, thres, thresholdValueUp, 1024, cv::THRESH_TOZERO_INV);
cv::threshold(thres, thres, 1, 1024, cv::THRESH_BINARY);

Then we use OpenCV bitwise_and operation on the color image and the mask. We also need to convert the mask to CV_8UC1 because that the format needed by bitwise_and. Finally we will get the result image that remove the background.Copy

thres.convertTo(thres, CV_8UC1, 255.0 / 1024.0);
cv::Mat res;
cv::bitwise_and(colorMat, colorMat, res, thres);

Full code #

remove-background.cpp

Updated on 2025 年 6 月 26 日
LIPSedge SDK
range-filterrecord
Table of Contents
  • Overview
  • Expect Output
  • Prerequisite
  • Tutorial
  • Full code

#LIPS

About Us

Store

Blog

Terms of Use

DEVELOPER

Technical Support

SDK Download

Code Samples

Github

Copyright © 2026 LIPS Corporation | Privacy Policy | Cookie Policy | Do Not Sell My Personal Information