@@ -23,13 +23,24 @@ class VisionClient extends Resource implements ResourceRPCClient {
23
23
VisionClient (this .name, this .channel);
24
24
25
25
/// Get a list of [Detection] s from the camera named [cameraName] .
26
+ ///
27
+ /// ```
28
+ /// // Example:
29
+ /// var detections = await myVisionService.detectionsFromCamera('myWebcam');
30
+ /// ```
26
31
Future <List <Detection >> detectionsFromCamera (String cameraName, {Map <String , dynamic >? extra}) async {
27
32
final request = GetDetectionsFromCameraRequest (name: name, cameraName: cameraName, extra: extra? .toStruct ());
28
33
final response = await client.getDetectionsFromCamera (request);
29
34
return response.detections;
30
35
}
31
36
32
- /// Get a list of [Detection] s from the provided [image] .
37
+ /// Get a list of [Detection] s from the provided [ViamImage] .
38
+ ///
39
+ /// ```
40
+ /// // Example:
41
+ /// var latestImage = await myWebcam.image();
42
+ /// var detections = await myVisionService.detections(latestImage);
43
+ /// ```
33
44
Future <List <Detection >> detections (ViamImage image, {Map <String , dynamic >? extra}) async {
34
45
final request = GetDetectionsRequest (
35
46
name: name,
@@ -44,6 +55,11 @@ class VisionClient extends Resource implements ResourceRPCClient {
44
55
45
56
/// Get a list of [Classification] s from the camera named [cameraName] .
46
57
/// The maximum number of [Classification] s returned is [count] .
58
+ ///
59
+ /// ```
60
+ /// // Example:
61
+ /// var classifications = await myVisionService.classificationsFromCamera('myWebcam', 2);
62
+ /// ```
47
63
Future <List <Classification >> classificationsFromCamera (String cameraName, int count, {Map <String , dynamic >? extra}) async {
48
64
final request = GetClassificationsFromCameraRequest (name: name, cameraName: cameraName, n: count, extra: extra? .toStruct ());
49
65
final response = await client.getClassificationsFromCamera (request);
@@ -52,6 +68,12 @@ class VisionClient extends Resource implements ResourceRPCClient {
52
68
53
69
/// Get a list of [Classification] s from the provided [image] .
54
70
/// The maximum number of [Classification] s returned is [count] .
71
+ ///
72
+ /// ```
73
+ /// // Example:
74
+ /// var latestImage = await myWebcam.image();
75
+ /// var classifications = await myVisionService.classifications(latestImage, 2);
76
+ /// ```
55
77
Future <List <Classification >> classifications (ViamImage image, int count, {Map <String , dynamic >? extra}) async {
56
78
final request = GetClassificationsRequest (
57
79
name: name,
@@ -66,6 +88,11 @@ class VisionClient extends Resource implements ResourceRPCClient {
66
88
}
67
89
68
90
/// Get a list of [PointCloudObject] s from the camera named [cameraName] .
91
+ ///
92
+ /// ```
93
+ /// // Example:
94
+ /// var ptCloud = await myVisionService.objectPointClouds('myCamera');
95
+ /// ```
69
96
Future <List <PointCloudObject >> objectPointClouds (String cameraName, {Map <String , dynamic >? extra}) async {
70
97
final request = GetObjectPointCloudsRequest (name: name, cameraName: cameraName, mimeType: MimeType .pcd.name, extra: extra? .toStruct ());
71
98
final response = await client.getObjectPointClouds (request);
0 commit comments