Skip to content

📷 Cross-platform API for Intel® RealSense™ devices

License

Apache-2.0, Unknown licenses found

Licenses found

Apache-2.0
LICENSE
Unknown
COPYING
Notifications You must be signed in to change notification settings

aangerma/librealsense

 
 

Repository files navigation




Linux Windows
Build Status Build status

Overview

Intel® RealSense™ SDK 2.0 is a cross-platform library for working with Intel® RealSense™ depth cameras (D400 series and the SR300).

For other Intel® RealSense™ devices, please refer to the latest legacy release.

The SDK allows depth, color and fisheye streaming, and provides intrinsic and extrinsic calibration information. The library also offers synthetic streams (pointcloud, depth aligned to color and vise-versa), and a built-in support for record and playback of streaming sessions.

The library aims to provide an easy to use API and tools for computer vision professionals, game developers and other Intel® RealSense™ technology enthusiasts.

We provide a C, C++, Python and Node.js API. Developer kits containing the necessary hardware to use this library are available for purchase at click.intel.com.

Quick Start

Step 1: Download and Install

After installing the Intel RealSense SDK (on Linux \ Windows \ OSX), and connecting the depth camera, you are ready to start writing your first application.

In case of any issue during initial setup, or later, please first see our FAQ & Troubleshooting section. If you can't find an answer there, try searching our Closed GitHub Issues page, Community and Support sites. If none of the above helped, open a new issue.

Step 2: Ready to Hack!

Our library offers a high level API for using Intel RealSense depth cameras (in addition to lower level ones). The following snippet shows how to start streaming frames and extracting the depth value of a pixel:

// Create a Pipeline - this serves as a top-level API for streaming and processing frames
rs2::pipeline p;

// Configure and start the pipeline
p.start();

while (true)
{
    // Block program until frames arrive
    rs2::frameset frames = p.wait_for_frames(); 
    
    // Try to get a frame of a depth image
    rs2::depth_frame depth = frames.get_depth_frame(); 
    // The frameset might not contain a depth frame, if so continue until it does
    if (!depth) continue;

    // Get the depth frame's dimensions
    float width = depth.get_width();
    float height = depth.get_height();
    
    // Query the distance from the camera to the object in the center of the image
    float dist_to_center = depth.get_distance(width / 2, height / 2);
    
    // Print the distance 
    std::cout << "The camera is facing an object " << dist_to_center << " meters away \r";
}

For more information on the library, please follow our examples, and read the documentation to learn more.

Contributing

In order to contribute to Intel RealSense SDK, please follow our contribution guidelines.

License

This project is licensed under the Apache License, Version 2.0. Copyright 2017 Intel Corporation

About

📷 Cross-platform API for Intel® RealSense™ devices

Resources

License

Apache-2.0, Unknown licenses found

Licenses found

Apache-2.0
LICENSE
Unknown
COPYING

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C++ 85.4%
  • JavaScript 7.3%
  • C 3.7%
  • CMake 1.2%
  • Shell 1.2%
  • CSS 0.4%
  • Other 0.8%