Main Page
Namespaces
Classes
Files
File List
File Members
scripts
pycamera.py
Go to the documentation of this file.
1
#!/usr/bin/env python
2
# coding=utf-8
3
######################################################################################
4
#> File Name: pycamera.py
5
#> Author:Rocwang
6
#> Mail: wangpeng@droid.ac.cn;
7
#> Github:https://github.com/yowlings
8
#> Created Time: 2018年07月05日 星期四 11时40分33秒
9
######################################################################################
10
# created by Huang Lu
11
# 27/08/2016 17:05:45
12
# Department of EE, Tsinghua Univ.
13
14
import
cv2
15
import
numpy
as
np
16
17
18
cv2.namedWindow(
"capture"
)
19
cap = cv2.VideoCapture(2)
20
while(1):
21
# get a frame
22
ret, frame = cap.read()
23
# show a frame
24
# print len(frame[0])
25
cv2.imshow(
"capture"
, frame)
26
# cv2.imwrite("1b.jpg",frame)
27
if
cv2.waitKey(1) & 0xFF == ord(
'q'
):
28
break
29
cap.release()
30
cv2.destroyAllWindows()
xbot_tools
Author(s):
autogenerated on Sat Oct 10 2020 03:28:22