Skip to content

Instantly share code, notes, and snippets.

@Euler29
Last active June 10, 2018 13:23
Show Gist options
  • Save Euler29/e123d55679dda340ea3e738751e8fd4a to your computer and use it in GitHub Desktop.
Save Euler29/e123d55679dda340ea3e738751e8fd4a to your computer and use it in GitHub Desktop.
otonom_araba_kod_3
def roi(img,vertices):
mask=np.zeros_like(img)
cv2.fillPoly(mask,vertices,255)
masked=cv2.bitwise_and(img,mask)
return masked
def cizgi_bul(img):
img=img
dimensions=img.shape
print('height',img.shape[0],'width',img.shape[1])
witdh=img.shape[1]
edges=cv2.Canny(img,150,175)
edges=cv2.GaussianBlur(edges,(5,5),0)
vertices=np.array([[0,480],[0,300],[640,300],[640,480]],np.int32)
edges=roi(edges,[vertices])
lines=cv2.HoughLinesP(edges,1,np.pi/180,100,100,20)
return lines,witdh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment