Skip to content

Instantly share code, notes, and snippets.

@victormurcia
Created October 29, 2022 23:26
Show Gist options
  • Save victormurcia/8a896230f41fd2b096ff94b08dc9b266 to your computer and use it in GitHub Desktop.
Save victormurcia/8a896230f41fd2b096ff94b08dc9b266 to your computer and use it in GitHub Desktop.
get_pixel_coords for blade coater alignment
class StoreCoordinates:
def __init__(self):
self.points = []
def select_point(self,event,x,y,flags,param):
if event == cv2.EVENT_LBUTTONDOWN:
# Display the clicked coordinates on shell
print(x, ' ', y)
# displaying the coordinates on the image window
font = cv2.FONT_HERSHEY_SCRIPT_SIMPLEX
text = str(x) + ',' + str(y)
cv2.putText(copy, text, (x,y), font, 0.5, (255, 255, 255), 2)
cv2.imshow('Blade-Coater Alignment', copy)
self.points.append((x,y))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment