Skip to content

Commit

Permalink
Update color_detection.py
Browse files Browse the repository at this point in the history
  • Loading branch information
gurvinder08 authored Dec 14, 2021
1 parent cdd14e0 commit 3cc486a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions color_detection.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def recognize_color(R,G,B):
# cv2.rectangle(image, startpoint, endpoint, color, thickness)-1 fills entire rectangle
cv2.rectangle(img, (20, 20), (750, 60), (b, g, r), -1)
#creating textstring to display (color name and RGB values)
text = recognize_color(r,g,b) + 'R=' + str(r) + 'G=' + str(g) + 'B=' + str(b)
text = recognize_color(r,g,b) + ' R=' + str(r) + ' G=' + str(g) + ' B=' + str(b)
# cv2.putText(img,text,start,font(0-7),fontScale,color,thickness,lineType )
cv2.putText(img,text,(50,50),2,0.8,(255,255,255),2,cv2.LINE_AA)
# for light colors
Expand All @@ -64,4 +64,4 @@ def recognize_color(R,G,B):
if cv2.waitKey(20) & 0xFF==27:
break

cv2.destroyAllWindows()
cv2.destroyAllWindows()

0 comments on commit 3cc486a

Please sign in to comment.