Skip to content

Instantly share code, notes, and snippets.

@Euler29
Created June 10, 2018 15:29
Show Gist options
  • Save Euler29/977f0c7ceca8863b6e03b104f2708f20 to your computer and use it in GitHub Desktop.
Save Euler29/977f0c7ceca8863b6e03b104f2708f20 to your computer and use it in GitHub Desktop.
otonom_araba_kod_6
for frame in camera.capture_continuous(rawCapture,format="bgr",use_video_port=True):
t1=time.time()
img=frame.array
gray=cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
if stop_sign_detect(gray)==False:
lines,witdh=cizgi_bul(gray)
a=egim_bul(lines,witdh)
if a=='ileri':
mc.forwardDrive()
elif a=='sola':
mc.forwardTurnLeft()
elif a=='saga':
mc.forwardTurnRight()
else:
mc.allStop()
print('Stop Algılandı.')
t2=time.time()
print(1/(t2-t1),'FPS')
rawCapture.truncate(0)
if cv2.waitKey(1) & 0xFF == ord('q'):
cv2.destroyAllWindows()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment