Skip to content

Instantly share code, notes, and snippets.

@Yuktha-Majella
Created October 26, 2021 14:44
Show Gist options
  • Save Yuktha-Majella/144cd6f533ada7e27efd95d7978d6a45 to your computer and use it in GitHub Desktop.
Save Yuktha-Majella/144cd6f533ada7e27efd95d7978d6a45 to your computer and use it in GitHub Desktop.
#Acessing Red value in coordinates (50, 50)
print("Pixel value of Red in (50,50) coordinate: ", img_mod1.item(50,50,2))
# modifying Red value in coordinates (50, 50)
img_mod1.itemset((50,50,2), 225)
print("Pixel value of Red in (50,50) coordinate after modification: ", img_mod1.item(50,50,2))
cv2.imshow('Billiards Modified', img_mod1)
cv2.waitKey(0)
cv2.destroyAllWindows()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment