AttributeError: 'module' object has no attribute 'boxPoints' in 2.4.9 [closed]
There has been a previous question asked here (http://answers.opencv.org/question/32183/cv2boxpoints-used-in-tutorials-does-not-exist-in/) but I couldn't get the solution working in my case.
I am trying to use cv2.boxPoints() in python. I am pretty sure OpenCV 2.4.9 does have this method as I compared the files changed in the following pull-request ( https://github.com/Itseez/opencv/pull/1041/commits) regarding the boxPoints and I find all the code rightly placed. Even so, my Vim editor also auto-completes the cv2.boxPoints() method.
But it throws the same error again and again.I have tried using OpenCV 3.0 technical preview too, but it has not helped. If there's anyway in which I can correct this in the current 2.4.9 installed in my system?
I can't find the function in the doc, could you please post a relevant part of your code to help us understand what is wrong?
Mathieu,
>>> import cv2
>>> cv2.__version__
'3.0.0-dev'
>>> help(cv2.boxPoints)
Help on built-in function boxPoints in module cv2:
boxPoints(...)
boxPoints(box[, points]) -> points
also, it is definitely not in yesterdays 2.4.9 version, the pr mentioned above is for the master version, not for 2.4
cv2.drawContours(carsample, contours, -1, (0,255,0), 3)
cv2.imshow("contoured image", carsample)
for i in contours: rect=cv2.minAreaRect(i)
cv2.waitKey(0)
cv2.destroyAllWindows()
This when run, shows the contoured image correctly. But after that I get this: box=cv2.boxPoints(rect)
AttributeError: 'module' object has no attribute 'boxPoints'
Thanks @berak, it's helpful indeed, but I mean on the online doc of OpenCV (better to share).
sorry, yes, here it is: boxpoints
http://opencv-python-tutroals.readthedocs.org/en/latest/py_tutorials/py_imgproc/py_contours/py_contour_features/py_contour_features.html#b-rotated-rectangle.
I was following the above link.
Kislay, you're bad at loosing ;)
those tutorials apply only to the master version, too.
just accept, that you're out of luck with 2.4.9.
Hmm... I knew something like this would happen. Thats why I cloned the latest development repo too from Github. Let me build it! That should do, right?
yes. try
git branch
first, to see where you are, andgit checkout master
orgit checkout 2.4
to select the version. then run cmake ...