Skip to content

Commit 858c146

Browse files
committed
Document r.camera.capture function
This function is only available on 2022.1.0 and later versions of the kit software.
1 parent 6897fc4 commit 858c146

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

programming/sr/vision/index.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,24 @@ R = Robot()
7171
marker_ids = R.camera.save(R.usbkey / "initial-view.png")
7272
~~~~~
7373

74+
capture
75+
: Take a photo through the webcam, and return the image data as an OpenCV array.
76+
77+
<div class="info">
78+
This feature is only available on version 2022.1.0 or later of the kit.
79+
</div>
80+
81+
~~~~~ python
82+
import cv2
83+
from sr.robot3 import *
84+
R = Robot()
85+
86+
frame = R.camera.capture()
87+
88+
# Flip the image with OpenCV
89+
flipped = cv2.flip(frame, 0)
90+
~~~~~
91+
7492
[Field of View](#fov) {#fov}
7593
-------------------
7694

0 commit comments

Comments
 (0)