# 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):
s,e,f,d = defects[i,0]
start = tuple(cnt[s])
end = tuple(cnt[e])
far = tuple(cnt[f])

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

### 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):
s,e,f,d = defects[i,0]
start = tuple(cnt[s])
end = tuple(cnt[e])
far = tuple(cnt[f])

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?