Help with the basics

asked 2016-02-15 22:14:31 -0500

I'm really new to Open CV and could really use some guidance. I'm not even able to load an image to open cv, I'm using python.

edit retag flag offensive close merge delete



have a look at the tutorials ,

e.g. here

then come back ?

berak gravatar imageberak ( 2016-02-16 01:01:00 -0500 )edit

Maybe you can watch this video first: opencv-python. Then you can try to understand this tutorial

Aj-611 gravatar imageAj-611 ( 2016-02-16 02:55:27 -0500 )edit

Ok Thank you. For loading the image, what should be the Image location? It isn't loading images at the desktop and download folder (OS X)

Sanyam Bhutani gravatar imageSanyam Bhutani ( 2016-02-16 06:52:32 -0500 )edit

if you're trying to do something like this

img = cv2.imread('messi5.jpg')

than the image location is where your Python script is. Otherwise you should specify path to image

strann gravatar imagestrann ( 2016-02-16 07:48:24 -0500 )edit

Ok. How do I load an image at a custom path. Say my desktop?

Sanyam Bhutani gravatar imageSanyam Bhutani ( 2016-02-17 04:48:41 -0500 )edit

img = cv2.imread('/home/user/Desktop/messi5.jpg')

strann gravatar imagestrann ( 2016-02-17 07:26:55 -0500 )edit

I get this error. OpenCV Error: Assertion failed (size.width>0 && size.height>0) in imshow, file

Sanyam Bhutani gravatar imageSanyam Bhutani ( 2016-02-17 10:39:30 -0500 )edit

check if the path is correct

strann gravatar imagestrann ( 2016-02-18 03:45:44 -0500 )edit

It is, double checked it. I'm using OPENCV-3.1.0, on OS X

Sanyam Bhutani gravatar imageSanyam Bhutani ( 2016-02-18 11:29:16 -0500 )edit