You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: programming/vision/index.md
+26-12Lines changed: 26 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,7 +20,7 @@ For information on markers, see the [markers page](./markers).
20
20
21
21
## Camera
22
22
23
-
The interface to the vision system is through the camera, accessible through `robot.camera`, there are three functions available on the camera object:
23
+
The interface to the vision system is through the camera, accessible through `robot.camera`, there are two functions available on the camera object:
24
24
25
25
see
26
26
: Take a photo using the webcam, and return a list of [`Marker`](#marker) instances, each of which describes one of the markers that were found in the image.
@@ -47,17 +47,6 @@ Taking images while moving will cause them to be blurry, which will cause marker
47
47
Try pausing movement while taking an image.
48
48
</div>
49
49
50
-
save
51
-
: Take a photo using the webcam, draw a box around the detected markers and save it to the provided location.
You can also save a snapshot of what your webcam is currently seeing. This can be useful to debug your code.
90
+
91
+
This is done by adding the `save` parameter to the `see` or `capture` functions.
92
+
The parameter should be the filename to where you want to save the image.
93
+
94
+
If used with the `see` function, every marker that your robot can see will have a square annotated around it, with a red dot indicating the top left corner of the marker.
95
+
The ID of every marker is also written next to it.
96
+
97
+
Snapshots are saved to your USB drive, and can be viewed on another computer.
98
+
99
+
```python
100
+
from sr.robot3 import*
101
+
102
+
robot = Robot()
103
+
104
+
# Save a snapshot of what the camera is currently seeing
105
+
frame = robot.camera.capture(save="snapshot.jpg")
106
+
107
+
# Save a snapshot of what the camera is currently seeing with markers annotated
0 commit comments