Get the geometries of the component in their current configuration
Return a frame from a camera.
const camera = new VIAM.CameraClient(machine, 'my_camera');
const image = await camera.getImage();
// Convert Uint8Array to base64
const base64Image = btoa(
Array.from(image)
.map((byte) => String.fromCharCode(byte))
.join('')
);
// Convert image to base64 and display it
const imageElement = document.createElement('img');
imageElement.src = `data:image/jpeg;base64,${base64Image}`;
const imageContainer = document.getElementById('#imageContainer');
if (imageContainer) {
imageContainer.innerHTML = '';
imageContainer.appendChild(imageElement);
}
For more information, see Camera API.
Return a point cloud from a camera.
const camera = new VIAM.CameraClient(machine, 'my_camera');
const pointCloud = await camera.getPointCloud();
For more information, see Camera API.
Return the camera properties.
const camera = new VIAM.CameraClient(machine, 'my_camera');
const properties = await camera.getProperties();
For more information, see Camera API.
Readonly
nameThe name of the resource.
Render a frame from a camera to an HTTP response.
const camera = new VIAM.CameraClient(machine, 'my_camera');
const mimeType = 'image/jpeg';
const image = await camera.renderFrame(mimeType);
For more information, see Camera API.
Represents any physical hardware that can capture frames.