robopipe.io
SolutionShopAbout UsDocumentationSupport
  • Welcome
  • Getting started
    • Setup
    • Hello world
  • Examples
    • Capsule counting
  • API
    • REST API Reference
      • Cameras
      • Streams
      • Neural Network
      • Controller
      • Analog I/O
      • Digital I/O
      • Led
    • WebSocket API Reference
      • Video Stream
      • NN Inference
    • Configuration
  • Other
    • Supported devices
    • Generic Devices
    • Troubleshooting
  • Resources
    • Robopipe Reddit
    • Robopipe GitHub
    • Luxonis
    • Unipi
Powered by GitBook
On this page
Edit on GitHub
  1. API
  2. REST API Reference

Streams

PreviousCamerasNextNeural Network

Last updated 4 months ago

Each camera contains a number of sensors of different types. Each sensor (or combination of multiple sensors) provides an image stream which can be consumed directly as video stream, or fed as input into a neural network. Our API exposes operations through which these streams can be consumed or manipulated. Each stream is addresses either by its sensor name - or by its combined name - .

Depth API

Some camera models containing multiple image sensors, support a feature called Stereo Depth. This feature combines data from two image sensors at a time, to calculate the depth of the image in front of it. The result is a single image stream. The image will consist of depth data calculated by the camera, lighter areas will contain objects that are closer to the camera while darker areas will contain objects further away. This stream is configurable the same way as a single sensor.

Depth stream and the respective sensors it uses cannot be both active at the same time. E.g. if stream DEPTH_B_C is active, then streams CAM_B and CAM_C will be inactive and vice versa.

API Reference

List All Streams

get
Path parameters
mxidstringRequiredPattern: [A-Z0-9]+
Responses
200
Successful Response
application/json
Responseany
404
Camera not found
422
Validation Error
application/json
get
GET /cameras/{mxid}/streams/ HTTP/1.1
Host: robopipe-1.local
Accept: */*

No content

Activate Stream

post
Path parameters
stream_namestringRequiredPattern: CAM_[A-H]|DEPTH_[A-H]_[A-H]
mxidstringRequiredPattern: [A-Z0-9]+
Responses
201
Successful Response
application/json
Responseany
404
Camera or stream not found
422
Validation Error
application/json
post
POST /cameras/{mxid}/streams/{stream_name}/ HTTP/1.1
Host: robopipe-1.local
Accept: */*

No content

Deactivate Stream

delete
Path parameters
stream_namestringRequiredPattern: CAM_[A-H]|DEPTH_[A-H]_[A-H]
mxidstringRequiredPattern: [A-Z0-9]+
Responses
202
Successful Response
application/json
Responseany
404
Camera or stream not found
422
Validation Error
application/json
delete
DELETE /cameras/{mxid}/streams/{stream_name}/ HTTP/1.1
Host: robopipe-1.local
Accept: */*

No content

Get Stream Config

get
Path parameters
stream_namestringRequiredPattern: CAM_[A-H]|DEPTH_[A-H]_[A-H]
mxidstringRequiredPattern: [A-Z0-9]+
Responses
200
Successful Response
application/json
Responseany of
or
or
404
Camera or stream not found
422
Validation Error
application/json
get
GET /cameras/{mxid}/streams/{stream_name}/config HTTP/1.1
Host: robopipe-1.local
Accept: */*
{
  "resolution": [],
  "still_size": [],
  "preview_size": [],
  "video_size": [],
  "fps": 1
}

Get Stream Control

get
Path parameters
stream_namestringRequiredPattern: CAM_[A-H]|DEPTH_[A-H]_[A-H]
mxidstringRequiredPattern: [A-Z0-9]+
Responses
200
Successful Response
application/json
404
Camera or stream not found
422
Validation Error
application/json
get
GET /cameras/{mxid}/streams/{stream_name}/control HTTP/1.1
Host: robopipe-1.local
Accept: */*
{
  "exposure_time": 1,
  "sensitivity_iso": 1,
  "auto_exposure_enable": true,
  "auto_exposure_compensation": 1,
  "auto_exposure_limit": 1,
  "auto_exposure_lock": true,
  "contrast": 1,
  "brightness": 1,
  "saturation": 1,
  "chroma_denoise": 1,
  "luma_denoise": 1,
  "auto_whitebalance_lock": true,
  "auto_whitebalance_mode": "AUTO",
  "manual_whitebalance": 1,
  "focus": {
    "auto_focus_mode": "CONTINUOUS_VIDEO",
    "auto_focus_trigger": false,
    "lens_position": 0
  }
}

Capture Still Image

get
Path parameters
stream_namestringRequiredPattern: CAM_[A-H]|DEPTH_[A-H]_[A-H]
mxidstringRequiredPattern: [A-Z0-9]+
Query parameters
formatany ofOptionalDefault: jpeg
stringOptional
or
nullOptional
Responses
200
Image bytes in the selected format
image/*
Responsestring
404
Camera or stream not found
422
Validation Error
application/json
get
GET /cameras/{mxid}/streams/{stream_name}/still HTTP/1.1
Host: robopipe-1.local
Accept: */*
text
  • Depth API
  • API Reference
  • GETList All Streams
  • POSTActivate Stream
  • DELETEDeactivate Stream
  • GETGet Stream Config
  • POSTUpdate Stream Config
  • GETGet Stream Control
  • POSTUpdate Stream Control
  • GETCapture Still Image

Update Stream Config

post
Path parameters
stream_namestringRequiredPattern: CAM_[A-H]|DEPTH_[A-H]_[A-H]
mxidstringRequiredPattern: [A-Z0-9]+
Body
any ofOptional
or
or
Responses
200
Successful Response
application/json
Responseany of
or
or
404
Camera or stream not found
422
Validation Error
application/json
post
POST /cameras/{mxid}/streams/{stream_name}/config HTTP/1.1
Host: robopipe-1.local
Content-Type: application/json
Accept: */*
Content-Length: 75

{
  "resolution": [],
  "still_size": [],
  "preview_size": [],
  "video_size": [],
  "fps": 1
}
{
  "resolution": [],
  "still_size": [],
  "preview_size": [],
  "video_size": [],
  "fps": 1
}

Update Stream Control

post
Path parameters
stream_namestringRequiredPattern: CAM_[A-H]|DEPTH_[A-H]_[A-H]
mxidstringRequiredPattern: [A-Z0-9]+
Body
exposure_timeinteger · min: 1 · max: 33000Optional

Exposure time in microseconds. Ignored if auto_exposure_enable is set to true. Value must be between 1 and 33000

sensitivity_isointeger · min: 100 · max: 5000Optional

Value must be between 100 and 5000

auto_exposure_enablebooleanOptional
auto_exposure_compensationinteger · min: -9 · max: 9Optional

Value must be between -9 and 9

auto_exposure_limitintegerOptional

Maximum exposure time limit for auto-exposure in microseconds

auto_exposure_lockbooleanOptional
contrastinteger · min: -10 · max: 10Optional

Value must be between -10 and 10

brightnessinteger · min: -10 · max: 10Optional

Value must be between -10 and 10

saturationinteger · min: -10 · max: 10Optional

Value must be between -10 and 10

chroma_denoiseinteger · max: 4Optional

Value must be between 0 and 4

luma_denoiseinteger · max: 4Optional

Value must be between 0 and 4

auto_whitebalance_lockbooleanOptional
auto_whitebalance_modestring · enumOptionalPossible values:
manual_whitebalanceinteger · min: 1000 · max: 12000Optional

Value must be between 1000 and 12000

focusany ofOptional
or
nullOptional
Responses
200
Successful Response
application/json
404
Camera or stream not found
422
Validation Error
application/json
post
POST /cameras/{mxid}/streams/{stream_name}/control HTTP/1.1
Host: robopipe-1.local
Content-Type: application/json
Accept: */*
Content-Length: 405

{
  "exposure_time": 1,
  "sensitivity_iso": 1,
  "auto_exposure_enable": true,
  "auto_exposure_compensation": 1,
  "auto_exposure_limit": 1,
  "auto_exposure_lock": true,
  "contrast": 1,
  "brightness": 1,
  "saturation": 1,
  "chroma_denoise": 1,
  "luma_denoise": 1,
  "auto_whitebalance_lock": true,
  "auto_whitebalance_mode": "AUTO",
  "manual_whitebalance": 1,
  "focus": {
    "auto_focus_mode": "CONTINUOUS_VIDEO",
    "auto_focus_trigger": false,
    "lens_position": 0
  }
}
{
  "exposure_time": 1,
  "sensitivity_iso": 1,
  "auto_exposure_enable": true,
  "auto_exposure_compensation": 1,
  "auto_exposure_limit": 1,
  "auto_exposure_lock": true,
  "contrast": 1,
  "brightness": 1,
  "saturation": 1,
  "chroma_denoise": 1,
  "luma_denoise": 1,
  "auto_whitebalance_lock": true,
  "auto_whitebalance_mode": "AUTO",
  "manual_whitebalance": 1,
  "focus": {
    "auto_focus_mode": "CONTINUOUS_VIDEO",
    "auto_focus_trigger": false,
    "lens_position": 0
  }
}