: OpenCV(4.5.2) C:\Users\runneradmin\AppData\Local\Temp\pip-req-build-vi271kac\opencv\modules\imgcodecs\src\loadsave.cpp:721: error: (-215:Assertion failed) !_img.empty() in function 'cv::imwrite' code example

Example: opencv(4.4.0) c:\users\appveyor\appdata\local\temp\1\pip-req-build-71670poj\opencv\modules\imgproc\src\color.cpp:182: error: (-215:assertion failed) !_src.empty() in function

This problem says that an assertion is failed. If the file doesn't exist in the given path, cv2 returns this error. So check if the file exists in your given path

Tags:

Misc Example