3

Code:Detect Lines Opencv in object -> Amid response

Case1:

for xxx in contours:
   [vx,vy,x,y] = cv2.fitLine(xxx,cv2.cv.CV_DIST_L2,0,0.01,0.01)

It throws error -

AttributeError: module 'cv2' has no attribute 'cv'

Case2:

for xxx in contours:
   [vx,vy,x,y] = cv2.fitLine(xxx,cv2.CV_DIST_L2,0,0.01,0.01)

It throws error -

AttributeError: module 'cv2' has no attribute 'CV_DIST_L2'

I have opencv 3 installed in my machine. I am not able to debug this error. Please let me know what mistake am I doing?

i.n.n.m
  • 2,936
  • 7
  • 27
  • 51

1 Answers1

4

just try DIST_L2 without CV it should work