Score
0
63 Unstar Star 241 Fork 62

Timthony / self_drivePython

Create your Gitee Account
Explore and code with more than 5 million developers,Free private repositories !:)
Sign up
This repository doesn't specify license. Without author's permission, this code is only for learning and cannot be used for other purposes.
基于树莓派的自动驾驶小车,利用树莓派和Tensorflow实现小车在赛道的自动驾驶 spread retract

https://github.com/Timthony/self_drive

Clone or download
collectdata_zth 835 Bytes
Copy Edit Web IDE Raw Blame History
Timthony authored 2018-09-29 22:41 . 注释
import io
import os
import threading
import time
import picamera
class SplitFrames(object):
def __init__(self):
self.frame_num = 0
self.output = 0
# 处理图像的函数write,实时保存每一张照片
# 对视频拍摄的每一帧进行处理,构造一个自定义输出类,每拍摄一帧都会进来write处理
def write(self, buf):
global key
if buf.startswith(b'\xff\xd8'): # 代表一个JPG图片的开始,新照片的开头
if self.output:
self.output.close()
self.frame_num += 1
self.output = io.open('%s_image%s.jpg' % (key, time()), 'wb') # 打开
self.output.write(buf)
while True:
# 多线程处理照片
#with picamera.Picamera(resolution=('160, 120')) as camera:
#pass

Comment ( 0 )

Sign in for post a comment

Python
1
https://gitee.com/tiantianhang/self_drive.git
git@gitee.com:tiantianhang/self_drive.git
tiantianhang
self_drive
self_drive
master

Search

131423 f1aaba0b 1899542 094922 1c74bed3 1899542