Ask Your Question

Revision history [back]

Converting image to grayscale

hi a newbie in python and opencv here.i tried to convert a picture from coloured to grayscale but it has an error,eventhou i take that code from youtube and all of my friends tried it and it work.i don't know what went wrong here is the error :

cv2.imshow('Original',image)

cv2.error: OpenCV(4.4.0) D:\Build\OpenCV\opencv-4.4.0\modules\highgui\src\window.cpp:384: error: (-215:Assertion failed) size.width>0 && size.height>0 in function 'cv::imshow'

can any of you guys help me solving this problem.i'm using python 3.9.0 and opencv_python-4.4.0-cp39-cp39-win_amd64.whl i believe both are the latest version.