@@ -15,6 +15,13 @@ export interface Vision extends Resource {
15
15
/**
16
16
* Get a list of detections in the next image given a camera.
17
17
*
18
+ * @example
19
+ *
20
+ * ```ts
21
+ * const vision = new VIAM.VisionClient(machine, 'my_vision');
22
+ * const detections = await vision.getDetectionsFromCamera('my_camera');
23
+ * ```
24
+ *
18
25
* @param cameraName - The name of the camera to use for detection.
19
26
* @returns - The list of Detections.
20
27
*/
@@ -26,6 +33,22 @@ export interface Vision extends Resource {
26
33
/**
27
34
* Get a list of detections in the given image.
28
35
*
36
+ * @example
37
+ *
38
+ * ```ts
39
+ * const camera = new VIAM.CameraClient(machine, 'my_camera');
40
+ * const vision = new VIAM.VisionClient(machine, 'my_vision');
41
+ *
42
+ * const mimeType = 'image/jpeg';
43
+ * const image = await camera.getImage(mimeType);
44
+ * const detections = await vision.getDetections(
45
+ * image,
46
+ * 600,
47
+ * 600,
48
+ * mimeType
49
+ * );
50
+ * ```
51
+ *
29
52
* @param image - The image from which to get detections.
30
53
* @param width - The width of the image.
31
54
* @param height - The height of the image.
@@ -43,6 +66,16 @@ export interface Vision extends Resource {
43
66
/**
44
67
* Get a list of classifications in the next image given a camera.
45
68
*
69
+ * @example
70
+ *
71
+ * ```ts
72
+ * const vision = new VIAM.VisionClient(machine, 'my_vision');
73
+ * const classifications = await vision.getClassificationsFromCamera(
74
+ * 'my_camera',
75
+ * 10
76
+ * );
77
+ * ```
78
+ *
46
79
* @param cameraName - The name of the camera to use for classification.
47
80
* @param count - The number of Classifications requested.
48
81
* @returns - The list of Classifications.
@@ -56,6 +89,23 @@ export interface Vision extends Resource {
56
89
/**
57
90
* Get a list of classifications in the given image.
58
91
*
92
+ * @example
93
+ *
94
+ * ```ts
95
+ * const camera = new VIAM.CameraClient(machine, 'my_camera');
96
+ * const vision = new VIAM.VisionClient(machine, 'my_vision');
97
+ *
98
+ * const mimeType = 'image/jpeg';
99
+ * const image = await camera.getImage(mimeType);
100
+ * const classifications = await vision.getClassifications(
101
+ * image,
102
+ * 600,
103
+ * 600,
104
+ * mimeType,
105
+ * 10
106
+ * );
107
+ * ```
108
+ *
59
109
* @param image - The image from which to get classifications.
60
110
* @param width - The width of the image.
61
111
* @param height - The height of the image.
@@ -76,6 +126,14 @@ export interface Vision extends Resource {
76
126
* Returns a list of the 3D point cloud objects and associated metadata in the
77
127
* latest picture obtained from the specified 3D camera.
78
128
*
129
+ * @example
130
+ *
131
+ * ```ts
132
+ * const vision = new VIAM.VisionClient(machine, 'my_vision');
133
+ * const pointCloudObjects =
134
+ * await vision.getObjectPointClouds('my_camera');
135
+ * ```
136
+ *
79
137
* @param cameraName - The name of the camera.
80
138
* @returns - The list of PointCloudObjects
81
139
*/
@@ -89,6 +147,13 @@ export interface Vision extends Resource {
89
147
* booleans indicating whether classifications, detections, and 3d
90
148
* segmentation are supported.
91
149
*
150
+ * @example
151
+ *
152
+ * ```ts
153
+ * const vision = new VIAM.VisionClient(machine, 'my_vision');
154
+ * const properties = await vision.getProperties();
155
+ * ```
156
+ *
92
157
* @returns - The properties of the vision service
93
158
*/
94
159
getProperties : ( extra ?: Struct ) => Promise < Properties > ;
@@ -97,6 +162,18 @@ export interface Vision extends Resource {
97
162
* Returns the requested image, classifications, detections, and 3d point
98
163
* cloud objects in the next image given a camera.
99
164
*
165
+ * @example
166
+ *
167
+ * ```ts
168
+ * const vision = new VIAM.VisionClient(machine, 'my_vision');
169
+ * const captureAll = await vision.captureAllFromCamera('my_camera', {
170
+ * returnImage: true,
171
+ * returnClassifications: true,
172
+ * returnDetections: true,
173
+ * returnObjectPointClouds: true,
174
+ * });
175
+ * ```
176
+ *
100
177
* @param cameraName - The name of the camera to use for classification,
101
178
* detection, and segmentation.
102
179
* @param opts - The fields desired in the response.
0 commit comments