Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Bmetry solutions provide an API in order to facilitate 3rd-party automation of image delivery. It is in development and will be extended in the future, but these endpoints should remain mostly stable.

Core concepts

There are a few key concepts that should be understood in order to use the API effectively.

Bmetry solution

A bmetry solution is a solution of 2 coupled cameras mounted on a crane intended for spectroscopic imaging of a construction site. A solution can function with only 1 or more than 2 cameras, though that is highly unusual.

Bmetry remote

A camera controller in a bmetry solution is called a remote. Thus, a bmetry solution usually has 2 remotes. Remotes in a Bmetry-solution are identified by their serial numbers, which is identical to the username that you enter for a camera when configuring it in the portal (for example 240116-5).

Remotes of a bmetry-solution must have the Tethering Mode peripheral to function properly.

Bmetry master

The master of a bmetry solution is the camera through which configuration and access to the solution are managed. The camera controller of a master is itself a normal remote. The master is really more of an abstract organisational tool than it is a technical distinction. The master is identified by its portal code (for example, E240102), that is, the primary identifier under which it is listed in the portal.

Bmetry masters must have the Bmetry peripheral to be recognised as such. All configuration of the system can be handled on the configuration page of the master, except for the peripheral configuration of the remotes. The masters controller is automatically a remote and does not need specific configuration.

ImageSequence

A Bmetry image sequence is a collection of image metadata that bundles together images that were captured during a run of the crane. A valid sequence should contain an image set that can be combined to a spectroscopic image, though it may contain more images than are strictly required.

...

Code Block
{
  "id":"2605684670271962334",
  "remotes":["230726-13","220715-05"],
   "start":"20240117T122423.156Z",
   "end":"20240117T122503.091Z",
   "state":"VALID"
 }

ImageInfo

Bmetry image info is a short set of metadata describing an image that was captured in a sequence and is stored on the camera. This is important to realise: The image ID in the image info has no relation to the name and timestamp of an image in the portal. It is used to identify and retrieve a specific image directly from the camera.

...

Also, do note that all images are purged from a camera around midnight in the cameras configured timezone.

Configuration

Most properties of a bmetry solution must be configured through the master. To make a camera the master of a solution, activate the bmetry peripheral in its peripheral configuration:

...

This peripheral must be configured in addition to the webcam controller, and the tethering mode. The tethering mode must be activated for every remote in a bmetry solution, no matter whether they are a master or not.

Once the peripherals are configured for all cameras that should form the solution, you can configure the solution properties in the configuration page of the master (the camera that has the bmetry peripheral activated):

...

Capture duration: The length of the sequence to capture, in seconds. This serves as a timeout for the entire capture operation after cameras are tethered and ready.

Capture frequency: How many times per second the cameras in the solution should capture an image. Currently this is the same setting for the entire solution, without distinguishing individual remotes.

Capture control: If set to start on motion, cameras will only start capturing once they detect motion in the crane. In this case, capture duration serves as a timeout. If set to start on command, cameras will start to capture as soon as they are ready and do so until capture duration is up.

Remotes: Here you can configure the remotes belonging to a solution. Just enabling tethered mode for all remotes is not enough, you need to group them together to a solution here, otherwise they don’t know who may talk to whom. The identifier for the remote is the serial number of its camera controller, which is the same thing you use as a username in portal:

...

The serial of the master is added implicitly and does not need to be configured.

API Documentation

In general there’s two types of endpoints in the API: One type is used to get information, the other is used to order the upload of images.

In general, for any of these endpoints you will need an HTTP client (such as for example curl), and you will need a user of at least power user level that has permissions for the master of the solution you want to send requests to. You can use HTTP basic-auth to authenticate.

Base URL

The base url for all requests is:

Code Block
https://api.yellow.camera/bmetry/

Data requests (GET)

Read all available sequences that a given solution has captured since last purge

...

Code Block
[
  {
    "id": "string",
    "remotes": ["string"],
    "start": "20240117T122423.156Z",
    "end": "20240117T122503.091Z",
    "state": "string"  // EXPERIMENTAL! Shows either VALID or INVALID. Currently, a valid sequence has consists of at least 70% of the expected images, and has no more than 10% of its images missing at the end (per remote).
  }
]

Read metadata on all images in a given sequence

...

Code Block
200 OK
[
  {
    "first": "string",
    "second": [
      {
        "imageId": "string",
        "time": "2024-01-17T15:48:45.580Z",
        "uploadCount": 0
      }
    ]
  }
]

Upload requests (POST)

Request upload of all images in a specific sequence

...