Giter Club home page Giter Club logo

realsense-webservice's Introduction

Web Service for Intel RealSense Camera

This is a web service written in python Flask for RealSense Cameras which are compatible with Intel RealSense SDK 2.0.
The end points are

  • startStream: Stream RGB frames from camera
  • getImage: Get the current RGB frame
  • getDepth: Get depth of a given point in RGB image
  • get3d: Get 3d coordinates in metre of a given point in RGB image

Prerequisites

  • Install latest version of python 2 with pip
  • Pip install python dependencies
    pip install Flask
    pip install numpy
    pip install opencv-python

Do NOT pip install pyrealsense2. This is the python wrapper for Intel RealSense SDK 1 (as of 27/06/2018)

  • Download and install Intel RealSense SDK 2 from here

Launching the web service

Connect your RealSense camera and run the python script cameraWebService
python cameraWebService.py

If you don't have a camera avalable, you can run the script testWebService
python testWebService.py
This uses a recorded camera data which can be downloaded from here

Endpoint Documentation

startStream

To start stream of RGB frames from camera

  • URL /startStream
  • Method GET
  • Success Response: The current RGB input from camera as MJPEG. The resolution will be max camera resolution.

getImage

To get the current RGB frame

  • URL /getImage
  • Method GET
  • Success Response: A JPEG image of the current RGB frame of camera input. The resolution will be max camera resolution.

getDepth

To get the current depth of an (x,y) pixel coordinate of the RGB image. The response will be a floating-point value as a string which correspond to the depth in metres. The request coordinates must be in bound with the maximum resolution.

  • URL /getDepth?x=[integer]&y=[integer]
  • Method GET
  • Success Response: 0.6550000309944153
  • Error Response: Invalid coordinate values

get3d

To get the current 3D real world coordinates in metres of an (x,y) pixel coordinate of the RGB image. The response will be x,y,z coordinates in JSON format. The request coordinates must be in bound with the maximum resolution.

  • URL /get3d?x=[integer]&y=[integer]
  • Method GET
  • Success Response:
    { "x": 0.5442482456265268 "y": 0.4660094894248493 "z": 0.3578798298485989 }
  • Error Response: Invalid coordinate values

Acknowledgement

License

This project is licensed under the MIT License. See the LICENSE file for details.

realsense-webservice's People

Stargazers

Hotuns avatar  avatar  avatar Banuprathap Anandan avatar Ravi Bathla avatar  avatar  avatar

Watchers

Dicky Mirrors avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.