I am trying to change the color of the image from RGB to grayscale using openCV, Python
My python code is as follows:
import cv2 ;
import numpy ;
img = cv2.imread(images/aiims.png) ;
gray = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY) ;
cv2.imshow('Original Image', img) ;
cv2.imshow('Gray Image', gray) ;
The Error That I am getting is :
File "test.py", line 11, in img = cv2.imread(images/aiims.png) ; NameError: name 'images' is not defined
I have already installed opencv
and numpy
.
I have the image in the image folder in the same directory, Please tell me if there is any flaw in my code, as I am very new to Python.
Thanks in Advance