forked from SintefManufacturing/python-aravis
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstreaming-plot.py
More file actions
34 lines (30 loc) · 788 Bytes
/
streaming-plot.py
File metadata and controls
34 lines (30 loc) · 788 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import sys
from aravis import Camera
import time
import matplotlib
#from pylab import bar, plot, show, legend, axis, subplot
import matplotlib.pyplot as plt
if __name__ == "__main__":
if len(sys.argv) > 1:
arg = sys.argv[1]
if arg in ("None", "null"):
cam = Camera()
else:
cam = Camera(arg)
else:
cam = Camera()
#cam.set_feature("GevSCPSPacketSize", 1500)
cam.start_acquisition_continuous()
try:
start = True
while True:
frame = cam.pop_frame()
plt.clf()
plt.plot(frame.T)
if start:
plt.show(block=False)
start = False
else:
plt.draw()
finally:
cam.stop_acquisition()