OpenCV Error: Assertion failed (size.width>0 && size.height>0) simple code

This error means that you are trying to show an empty image. When you load the image with imshow, this is usually caused by: The path of your image is wrong (in Windows escape twice directory delimiters, e.g. imread(“C:\path\to\image.png”) should be: imread(“C:\\path\\to\\image.png”), or imread(“C:/path/to/image.png”)); The image extension is wrong. (e.g. “.jpg” is different from “.jpeg”); You don’t have the rights … Read more

Cannot import cv2 in python in OSX

I do not know what pip install cv2 actually installs… but is surely not OpenCV. pip install cv2 actually installs this, which are some blog distribution utilities, not sure what it is, but it is not OpenCV. To properly install OpenCV, check any of the links @udit043 added in the comment, or refer to any … Read more