I built OpenCV from Source but I can't manage to use it. Every time I try to even load an image with the next code I get No module named cv2.cv. Why is that happening? How can I fix it?
from cv2.cv import *
img = LoadImage("/home/User/Desktop/Image.png")
NamedWindow("opencv")
ShowImage("opencv",img)
WaitKey(0)
The procedure I did was the following...
I downloaded the zip file from the main page of GitHub and while being in a destination directory I created, I built OpenCV using
cmake OpenCV_Source_Directory
Then on the destination directory I run
make
sudo make install
I found the solution to my problem. I had to install python-opencv as follows:
sudo apt-get install python-opencv
After that OpenCV works fine.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With