Adam Adam - 2 months ago 17
Python Question

Installation of OpenCV in Ubuntu 14.04

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

Answer

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.