Configure an Image File Camera
An image_file
camera gets color and depth image frames or point clouds from a file path on your local system.
Navigate to the Config tab of your robot’s page in the Viam app.
Click on the Components subtab and click Create component.
Select the camera
type, then select the image_file
model.
Enter a name for your camera and click Create.
Edit and fill in the attributes as applicable.
{
"name": "<your-camera-name>",
"type": "camera",
"model" : "image_file",
"attributes": {
"intrinsic_parameters": {
"width_px": <int>,
"height_px": <int>,
"fx": <float>,
"fy": <float>,
"ppx": <float>,
"ppy": <float>
},
"distortion_parameters": {
"rk1": <float>,
"rk2": <float>,
"rk3": <float>,
"tp1": <float>,
"tp2": <float>
},
"debug": <boolean>,
"color_image_file_path": "<your-file-path>",
"depth_image_file_path": "<your-file-path>",
"pointcloud_file_path": "<your-file-path>",
}
}
The following attributes are available for image_file
cameras:
Name | Type | Inclusion | Description |
---|---|---|---|
intrinsic_parameters | object | Optional | The intrinsic parameters of the camera used to do 2D <-> 3D projections:
|
distortion_parameters | object | Optional | Modified Brown-Conrady parameters used to correct for distortions caused by the shape of the camera lens:
|
debug | boolean | Optional | Enables the debug outputs from the camera if true .Default: false |
color_image_file_path | string | Optional | The file path to the color image on your local system. |
depth_image_file_path | string | Optional | The file path to the depth image on your local system. |
pointcloud_file_path | string | Optional | The file path to the point cloud file on your local system. |
You must specify at least one of color_image_file_path
, depth_image_file_path
, and pointcloud_file_path
.
If you provide configuration for the depth_image_file_path
and intrinsic_parameters
of the camera, then your robot will also retrieve point cloud data from the depth_image_file_path
.
If you then also configure a pointcloud_file_path
on your camera, Viam will try to pull the data from the pointcloud_file_path
first.
View the camera stream
Once your camera is configured and connected, go to the Control tab, and click on the camera’s dropdown menu. Then toggle the camera or the Point Cloud Data view to ON. If everything is configured correctly, you will see the live video feed from your camera. You can change the refresh frequency as needed to change bandwidth.

Next Steps
Have questions, or want to meet other people working on robots? Join our Community Discord.
Was this page helpful?
Glad to hear it! If you have any other feedback please let us know:
We're sorry about that. To help us improve, please tell us what we can do better:
Thank you!