# Revision history [back]

### How can i get angle and line length in Python OpenCV

I have a chunk of code to get start, end, far variable from Convexity Defects :

    hull = cv2.convexHull(cnt,returnPoints = False)
defects = cv2.convexityDefects(cnt,hull)

for i in range(defects.shape[0]):
s,e,f,d = defects[i,0]
start = tuple(cnt[s][0])
end = tuple(cnt[e][0])
far = tuple(cnt[f][0])

cv2.line(res,far,end,[0,255,0],2)
cv2.line(res,start,far,[0,255,0],2)


I need to dismissed convexity defect from finger if:

line_length<0.4lbb and angle>80o

So How can i get angle and line length value from those start, end, far variable? and dismissed convexity defect from given rule?

 2 retagged berak 30589 ●4 ●75 ●296

### How can i get angle and line length in Python OpenCV

I have a chunk of code to get start, end, far variable from Convexity Defects :

    hull = cv2.convexHull(cnt,returnPoints = False)
defects = cv2.convexityDefects(cnt,hull)

for i in range(defects.shape[0]):
s,e,f,d = defects[i,0]
start = tuple(cnt[s][0])
end = tuple(cnt[e][0])
far = tuple(cnt[f][0])

cv2.line(res,far,end,[0,255,0],2)
cv2.line(res,start,far,[0,255,0],2)


I need to dismissed convexity defect from finger if:

line_length<0.4lbb and angle>80o

So How can i get angle and line length value from those start, end, far variable? and dismissed convexity defect from given rule?