Skip to content

Instantly share code, notes, and snippets.

@skiptomyliu
Last active March 9, 2017 03:34
Show Gist options
  • Save skiptomyliu/ea6548773720c74ef226f35951ca118e to your computer and use it in GitHub Desktop.
Save skiptomyliu/ea6548773720c74ef226f35951ca118e to your computer and use it in GitHub Desktop.
1st degree polynomial
def get_slope(img_seg):
x,y = np.where(img_seg==True)
slope,_ = np.polyfit(x,y,1)
return -1*slope
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment