EYRCPlus-PS1#2271 Image Processing PDF
EYRCPlus-PS1#2271 Image Processing PDF
(eYRC+ Pilot)
<Please enter your team id here>
Team leader name
College
e-mail
Date
Nirlesh Singh
USICT
[email protected]
29/11/2015
Image Processing
(8)
>
Software used
(7)
img = cv2.imread('test_image1.jpg')
g1=input("enter the value of g")
#defining function
def color_grayscale(img,g): #taking the argument from the calling function. Img is coloured
if g==1:
#image and g is an integer
img2= cv2.cvtColor(img,cv2.COLOR_BGR2GRAY) # converting the coloured image into
else:
#grayscale
img2=img
return(img2)
#returning the image
img1=color_grayscale(img,g1)
cv2.imshow('image',img1)
cv2.waitKey(0)
cv2.destroyAllWindows()>