Configure a Fake Camera

A fake camera is a camera model for testing. The camera always returns the same image, which is an image of a chess board. This camera also returns a point cloud.

You can optionally specify either a height or width, and the image will be scaled to preserve a 16:9 aspect ratio. You cannot specify both a height and width.

On the COMPONENTS subtab, navigate to the Create Component menu. Enter a name for your camera, select the type camera, and select the fake model.

Creation of a join color depth view in the Viam app config builder.

Fill in the attributes for your join color depth view:

Configuration of a join color depth view in the Viam app config builder.
{
    "name": "<camera_name>",
    "type": "camera",
    "model" : "fake",
    "attributes": {
        "width": <integer>,
        "height": <integer>
    }
}

The following attributes are available for fake cameras:

NameInclusionDescription
widthOptionalThe width of the image in pixels. The default resolution is 1280 x 720. If you specify either width or height, the image gets scaled to preserve 16:9 aspect ratio. You cannot specify both width and height.
heightOptionalThe width of the image in pixels. The default resolution is 1280 x 720. If you specify either width or height, the image gets scaled to preserve 16:9 aspect ratio. You cannot specify both width and height

View the camera stream

Once your camera is connected, go to the CONTROL tab, and click on the camera’s dropdown menu. Toggle “View Camera”. If everything is configured correctly, you will see the live video feed from your camera.

Example Camera view inside Viam app

Next Steps