The error says that the image you opened doesn't satisfy the condition height > 0 and width > 0. This may have several reasons.
Most of the times, it is due to an inexistent image address given in imread.
Sometimes it may be also because the complier failed to load the image. For example, if you write some random strings in notepad and save the file as a.jpg, the compiler may not be able to load it