Python-OpenCv error-261
Question: I'm new to Python-OvenCV programming. I'm using python idle to load and
display image from folder. its showing the following error:

    
    
    **Traceback (most recent call last):   
    File "C:\Python27\a.py", line 4, in <module>
    
    
    cv2.imshow("abc",img)    
    error: ..\..\..\..\opencv\modules\highgui\src\window.cpp:261: error: (-215)   size.width>0 && size.height>0 in function cv::imshow**    
    

my code is:

    
    
    import cv2    
    import numpy as np    
    img = cv2.imread("C:\Users\Mayur\Desktop\ab.bmp",0)    
    cv2.imshow("abc",img)     
    cv2.waitKey()    
    

I have searched for solutions but they are all for matlab and I'm using python
IDLE.


Answer: You may have found the solution already, but ill give an answer anyways.

This is a common mistake when trying to read files in python. in my experience
python does not like the "\" when you are naming the file location. instead
you should use a "/". Here is what is should look like:

    
    
    img = cv2.imread("C:/Users/Mayur/Desktop/ab.bmp",0)
    

