EDIT: FYI, according to the best answer here , if you are just starting out (like me!), It is almost certainly better to use the older cv2 interface presented in cv2.cv. The author of this answer, Abid Rahman, has some lessons that look pretty good. (end of EDIT)
I used Debian tools to install the python-opencv package. There was no directory ... / dist -packages / opencv, and the cv.py file contained only:
from cv2.cv import *
I am pretty inexperienced with Python and completely with Python accessing external libraries, so it looked like a kind of workaround related to this. Not so, apparently. I followed Casper's link above and found the solution that he used (which worked for me), but I was not happy with the use of “forced built-in functions” when I was not completely sure of the consequences.
However, a second, lower rating is my preferred solution. Instead
import cv
I use
import cv2.cv as cv
From what I can say, this just removes the cv.py broker from the import chain, if that makes sense. Saving / closing / reloading my script meant that Eclipse recognized cv.LoadImageM as specific and autoconfirmed other things from OpenCV.
I am reproducing this answer here because it seems to me cleaner, and I first found this question when I was looking for an answer to the same problem.
source share