CvNameWindow class that adds zoom and pan functions to OpenCV's namedWindow
pip install cvzoomwindow
import cv2
import cvzoomwindow
# Image loading
img = cv2.imread("image.bmp")
# Instance of CvZoomWindow class
zw = cvzoomwindow.CvZoomWindow(
"Zoom Window" # Name of the window
)
# Displays an image
zw.imshow(img)
# Waits for a pressed key.
cv2.waitKey()
mouse operation | operation |
---|---|
Double click of left button | Display the entire image |
Double click of right button | Equal-size display of images |
Left button drag | Moving Images |
Mouse wheel up | Zoom up |
Mouse wheel down | Zoom down |