Computer Vision
Computer Vision is an interdisciplinary field that deals with how computers can be made for gaining high-level understanding from digital images or videos. From the perspective of engineering, it seeks to automate tasks that the human visual system can do. Wikipedia
1
[email protected]:~/Bitol/VirtualDroneSolution/UseCases/XunanKab/Tasks$ gst-launch-1.0 -v v4l2src ! video/x-raw,format=YUY2,width=640,height=480 ! jpegenc ! rtpjpegpay ! udpsink host=127.0.0.1 port=5000
2
[email protected]:~/Bitol/VirtualDroneSolution/UseCases/XunanKab/Tasks$ gst-launch-1.0 -v udpsrc port=5000 ! application/x-rtp, media=video, clock-rate=90000, encoding-name=JPEG, payload=26 ! rtpjpegdepay ! jpegdec ! xvimagesink sync=0
Copied!
1
import cv2
2
3
cap = cv2.VideoCapture(0)
4
5
framerate = 25.0
6
7
#out = cv2.VideoWriter('appsrc ! videoconvert ! '
8
# 'x264enc noise-reduction=10000 speed-preset=ultrafast tune=zerolatency ! '
9
# 'rtph264pay config-interval=1 pt=96 !'
10
# 'tcpserversink host=192.168.1.27 port=5000 sync=false',
11
# 0, framerate, (640, 480))
12
13
out = cv2.VideoWriter('appsrc ! videoconvert ! video/x-raw,format=YUY2,width=640,height=480 ! jpegenc ! rtpjpegpay ! '
14
'udpsink host=172.17.0.1 port=5000',
15
0, framerate, (640, 480))
16
17
while cap.isOpened():
18
ret, frame = cap.read()
19
if ret:
20
21
out.write(frame)
22
23
if cv2.waitKey(1) & 0xFF == ord('q'):
24
break
25
else:
26
break
27
28
# Release everything if job is finished
29
cap.release()
30
out.release()
31
32
[2] 0:docker*Z
Copied!
Last modified 3yr ago
Copy link