This file contains 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
//simulacion de trafico afectado por el cansancio de los conductores | |
//Encuentro de Processing 30 y 31 de Mayo | |
//controles globales del circuito | |
float curv=20;//curvatura del circuito: 100 = curvas muy cerradas, 0 = curvas muy abiertas | |
float ncurv=0.2;//numero de curvas: solo va bien con los valores 0.2, 0.1 y 0.05 | |
float ancho=3;//distancia entre los dos carriles | |
//Arrays de los puntos de la carretera | |
Vertice[] puntosInt=new Vertice[0];//lista que contiene todos los puntos del carril interior |
This file contains 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
//simulacion de trafico afectado por el cansancio de los conductores | |
//Encuentro de Processing 30 y 31 de Mayo | |
//controles globales del circuito | |
float curv=20;//curvatura del circuito: 100 = curvas muy cerradas, 0 = curvas muy abiertas | |
float ncurv=0.2;//numero de curvas: solo va bien con los valores 0.2, 0.1 y 0.05 | |
float ancho=10;//distancia entre los dos carriles | |
//Arrays de los puntos de la carretera |
This file contains 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 | |
img = cv2.imread('/path/to/file/line_02.jpg', 0) | |
edges = cv2.Canny(img, 100, 200) | |
cv2.imwrite('mycanny.jpg', edges) |
This file contains 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
from math import hypot, pi, cos, sin | |
from PIL import Image | |
import numpy as np | |
def hough(im, ntx=460, mry=360): | |
"Calculate Hough transform." | |
pim = im.load() | |
nimx, mimy = im.size | |
mry = int(mry/2)*2 #Make sure that this is even | |
him = Image.new("L", (ntx, mry), 255) |