Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 77 additions & 0 deletions src/services/vision/vision.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@ export interface Vision extends Resource {
/**
* Get a list of detections in the next image given a camera.
*
* @example
*
* ```ts
* const vision = new VIAM.VisionClient(machine, 'my_vision');
* const detections = await vision.getDetectionsFromCamera('my_camera');
* ```
*
* @param cameraName - The name of the camera to use for detection.
* @returns - The list of Detections.
*/
Expand All @@ -26,6 +33,22 @@ export interface Vision extends Resource {
/**
* Get a list of detections in the given image.
*
* @example
*
* ```ts
* const camera = new VIAM.CameraClient(machine, 'my_camera');
* const vision = new VIAM.VisionClient(machine, 'my_vision');
*
* const mimeType = 'image/jpeg';
* const image = await camera.getImage(mimeType);
* const detections = await vision.getDetections(
* image,
* 600,
* 600,
* mimeType
* );
* ```
*
* @param image - The image from which to get detections.
* @param width - The width of the image.
* @param height - The height of the image.
Expand All @@ -43,6 +66,16 @@ export interface Vision extends Resource {
/**
* Get a list of classifications in the next image given a camera.
*
* @example
*
* ```ts
* const vision = new VIAM.VisionClient(machine, 'my_vision');
* const classifications = await vision.getClassificationsFromCamera(
* 'my_camera',
* 10
* );
* ```
*
* @param cameraName - The name of the camera to use for classification.
* @param count - The number of Classifications requested.
* @returns - The list of Classifications.
Expand All @@ -56,6 +89,23 @@ export interface Vision extends Resource {
/**
* Get a list of classifications in the given image.
*
* @example
*
* ```ts
* const camera = new VIAM.CameraClient(machine, 'my_camera');
* const vision = new VIAM.VisionClient(machine, 'my_vision');
*
* const mimeType = 'image/jpeg';
* const image = await camera.getImage(mimeType);
* const classifications = await vision.getClassifications(
* image,
* 600,
* 600,
* mimeType,
* 10
* );
* ```
*
* @param image - The image from which to get classifications.
* @param width - The width of the image.
* @param height - The height of the image.
Expand All @@ -76,6 +126,14 @@ export interface Vision extends Resource {
* Returns a list of the 3D point cloud objects and associated metadata in the
* latest picture obtained from the specified 3D camera.
*
* @example
*
* ```ts
* const vision = new VIAM.VisionClient(machine, 'my_vision');
* const pointCloudObjects =
* await vision.getObjectPointClouds('my_camera');
* ```
*
* @param cameraName - The name of the camera.
* @returns - The list of PointCloudObjects
*/
Expand All @@ -89,6 +147,13 @@ export interface Vision extends Resource {
* booleans indicating whether classifications, detections, and 3d
* segmentation are supported.
*
* @example
*
* ```ts
* const vision = new VIAM.VisionClient(machine, 'my_vision');
* const properties = await vision.getProperties();
* ```
*
* @returns - The properties of the vision service
*/
getProperties: (extra?: Struct) => Promise<Properties>;
Expand All @@ -97,6 +162,18 @@ export interface Vision extends Resource {
* Returns the requested image, classifications, detections, and 3d point
* cloud objects in the next image given a camera.
*
* @example
*
* ```ts
* const vision = new VIAM.VisionClient(machine, 'my_vision');
* const captureAll = await vision.captureAllFromCamera('my_camera', {
* returnImage: true,
* returnClassifications: true,
* returnDetections: true,
* returnObjectPointClouds: true,
* });
* ```
*
* @param cameraName - The name of the camera to use for classification,
* detection, and segmentation.
* @param opts - The fields desired in the response.
Expand Down