Esempio n. 1
0
 def get(self, user_name: str):
     if request.headers.get(
             'idToken') and request.headers.get('idToken') != idToken:
         return jsonify({"result": "Token no valido", "ok": False})
     items = CarController.get_by_user(user_name)
     return jsonify({"status": "OK", "cart": items})
Esempio n. 2
0
 def post(self):
     if request.headers.get(
             'idToken') and request.headers.get('idToken') != idToken:
         return jsonify({"result": "Token no valido", "ok": False})
     CarController.save(request.json)
     return jsonify({"ok": True})
Esempio n. 3
0
def create_car(group):
    car = CarController(120, 72, group)
    car.pos = (WIDTH / 2, HEIGHT * 3 / 4)
    car.speed = 0
    car.angle = 0
    car.wheels_angle = 0
Esempio n. 4
0
from view import CarView
from controller import CarController
from model import Car

number = input('Give me a number from 0 to 1: ')

first_car = Car('Seat', 'Ibiza', 'Rojo')
second_car = Car('Fiat', '600', 'Blanco')
car_controller = CarController(first_car, second_car)
car_view = CarView(car_controller)
car = car_view.show_car(number)
print(car)
import cv2
import numpy as np
from controller import CarController

road_start_x = (800 / 2) - 112
road_end_x = (800 / 2) + 112
Controller = CarController(50, 100, 0, 0, road_start_x, road_end_x)

#Car Image
# car_img = cv2.imread('TestingImages/image_car.png')
car_img = cv2.imread('empty.jpg')
gray_car_img = cv2.cvtColor(car_img, cv2.COLOR_BGR2GRAY)
# cv2.imshow('Gray_car', gray_car_img)
#Sign Image
green_sign = cv2.imread('empty_sign.jpg')
gray_green_sign = cv2.cvtColor(green_sign, cv2.COLOR_BGR2GRAY)

###################################################################
###############  Test the car #####################################
tmp = Controller.car_match(gray_car_img)
if tmp is not None:
    a, b, c, d = tmp
    cv2.rectangle(car_img, (a, b), (c, d), (0, 0, 255), 2)
    cv2.imshow('Car', car_img)
    print('Car Detected Correctly')
else:
    print('Incorrect: Output is None')
# No traffic signs
# tmp = Controller.traffic_match(gray_car_img)
# if tmp is not None:
# 	a, b, c, d = tmp