This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cv2 | |
import numpy as np | |
def calculate_hull(img,sensitivity=0.25): | |
gray = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY) | |
gray = np.float32(gray) | |
corners = cv2.goodFeaturesToTrack(gray, 100, sensitivity, 10) | |
corners = np.int0(corners) | |
hull = cv2.convexHull(corners) | |
return hull |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import http.server | |
import socketserver | |
class Handler(http.server.BaseHTTPRequestHandler): | |
def do_GET(self): | |
if self.path == '/data': # handle any GET requests to /data | |
pass | |
elif self.path == '/annotation':# handle any GET requests to /annotation | |
pass | |
def do_POST(self): # handle general post event |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def sendToGoogleDrive(fileName,filePath,pathToClientSecrets="/PATH/TO/credentials.json"): | |
gauth = GoogleAuth() | |
gauth.LoadClientConfigFile(pathToClientSecrets) # <----- | |
drive = GoogleDrive(gauth) | |
folder_id = 'XXXX' // example .../folders/XXXX or ..../folders/13vovGVWKWz1KvFmBFwjxIMCT5dE-WFSx | |
file1 = drive.CreateFile({ | |
'title': 'data.csv', | |
"mimeType": "text/csv", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pigpio | |
import RPi.GPIO as GPIO | |
class PWM: | |
def __init__(self): | |
self.pi = pigpio.pi() | |
self.freq = 100 | |
self.steering = 0 | |
self.acceleration = 0 | |
self.gpioPinAcceleration = 18 |
NewerOlder