I started to learn opencv with Python, and right away i get an error. Im trying for an hour to find answer but I failing.
I want to read the image thats saved on my desktop, and py .py file is also saved on deskop.
This is my code:
import cv2
my_image = cv2.imread('slika.png', 0)
And I get this error:
AttributeError: module 'cv2' has no attribute 'imread'
I have installed open cv lib like this:
pip install opencv-python
When I do:
print(dir(cv2))
I get this:
['__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__spec__', 'cv2']
And this:
print(cv2.__file__)
#C:\Users\nenad\OneDrive\Desktop\cv2.py
Im using windows, Python 3.7 32-bit and IDLE that came with python (basic one) I know that this is basic, but what am i doing wrong?