Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installation of OpenCV in Ubuntu 14.04

Tags:

python

opencv

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

like image 952
Adam Avatar asked Jan 20 '26 05:01

Adam


1 Answers

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.

like image 124
Adam Avatar answered Jan 21 '26 22:01

Adam



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!