Skip to content

Instantly share code, notes, and snippets.

@victormurcia
Created September 3, 2022 01:33
Show Gist options
  • Save victormurcia/90cfdafe49a355c9dfe9c2bb54686db8 to your computer and use it in GitHub Desktop.
Save victormurcia/90cfdafe49a355c9dfe9c2bb54686db8 to your computer and use it in GitHub Desktop.
Color space conversion with Open CV
#Need function that reads pixel hue value
hsv = cv2.cvtColor(ori_img, cv2.COLOR_BGR2HSV)
#Plot the image
fig, axs = plt.subplots(1, 3, figsize = (15,15))
names = ['BGR','RGB','HSV']
imgs = [ori_img, img, hsv]
i = 0
for elem in imgs:
axs[i].title.set_text(names[i])
axs[i].imshow(elem)
axs[i].grid(False)
i += 1
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment