Skip to content

Commit 5eb2642

Browse files
committed
Update test_DecodeVideoByPiCamera.py
1 parent 9cb5199 commit 5eb2642

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

samples/test_DecodeVideoByPiCamera.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,9 @@ def read_barcode():
109109
stride = 0
110110
stream = io.BytesIO()
111111
camera.capture(stream, format='jpeg')
112-
# 从流构建numpy
112+
# create numpy by stream
113113
data = np.frombuffer(stream.getvalue(), dtype=np.uint8)
114-
# 通过opencv解码numpy
114+
# decode numpy by opencv
115115
image = cv2.imdecode(data, 1)
116116
stride = image.strides[0]
117117
print(stride)
@@ -152,6 +152,7 @@ def read_barcode():
152152

153153
# 'ESC' for quit
154154
key = cv2.waitKey(1)
155+
# reset
155156
rawCapture.truncate(0)
156157
if key == 27:
157158
break

0 commit comments

Comments
 (0)