Zoom in image to retrieve pixel coordinates

asked 2017-06-30 15:07:10 -0600

swiss_knight gravatar image

updated 2017-06-30 15:14:32 -0600

I would like to know if there is something I can do to zoom in the image I'm working with?
It is to select some double clicked points I want to grab their coordinates.
It's mainly for high-res images on which I'd like more precision.
Scale factor 1 image pixel = 1 screen pixel would be fine to reach.

Here's the current code:

image_points= list()
def grep_pos(event,x,y,flags,param):
    if event == cv2.EVENT_LBUTTONDBLCLK:
        cv2.circle(imgcolor,(x,y),10,(255,255,0),-1)
        image_points.append((x,y))
    if event == cv2.EVENT_MOUSEWHEEL:
        a="maybe do stuff here to zoom, but how ?"


cv2.namedWindow('image',cv2.WINDOW_NORMAL)
cv2.setMouseCallback('image',grep_pos)
while(1):
    cv2.imshow('image',imgcolor)
    if cv2.waitKey(20) & 0xFF == 27:
        break

cv2.destroyAllWindows()

And what is the part & 0xFF == 27 for?

edit retag flag offensive close merge delete