overlay-fps

command module
v0.0.0-...-23c9e2a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 28, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

README

overlay-fps modular resource

A virtual camera to overlay the frames-per-second (FPS) of the get_image() requests of the underlying camera

fps-camera-example

Requirements

Before configuring your overlay-fps camera, you must create a machine.

To use the overlay-fps camera you also need to configure a webcam or another camera.

Build and run

To use this module, follow these instructions to add a module from the Viam Registry and select the viam-labs:camera:overlay-fps model from the overlay-fps module.

Configure your overlay-fps camera

Navigate to the Config tab of your machine's page in the Viam app. Click on the Components subtab and click Create component. Select the camera type, then select the viam-labs:camera:overlay-fps model. Click Add module, then enter a name for your sensor and click Create.

On the new component panel, copy and paste the following attribute template into your camera’s Attributes box:

{
  "camera_name": "<CAMERA-NAME>"
}

Provide your camera's name in the model config.

[!NOTE] For more information, see Configure a Machine.

Attributes

The following attributes are available for the viam-labs:camera:overlay-fps sensor:

Name Type Inclusion Description
camera_name string Required The name of the camera to add the fps overlay to.
Example configuration
{
  "camera_name": "cam1"
}

To ensure the source camera starts up before the overlay-fps camera, add the source camera in the Depends on drop down of the overlay-fps camera.

The entire component configuration should resemble this:

{
  "name": "my-overlay-cam",
  "model": "viam-labs:camera:overlay-fps",
  "type": "camera",
  "namespace": "rdk",
  "attributes": {
    "camera_name": "my-webcam"
  },
  "depends_on": [
    "my-webcam"
  ]
}
Next steps

Go to the Control tab and enable the overlay-fps camera. You should now see the camera stream with the FPS overlay.

Local Development

This module is written in Go.

go mod tidy
go build

License

Copyright 2021-2023 Viam Inc.
Apache 2.0

Documentation

Overview

Package main is a module which serves the fps overlay module

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL