I'm currently using opencv-python to create an image viewer with drawing possibilities.
My aim is to have a full screen window containing the loaded image at its center.
I'm able to set the window in fullscreen and to show the image. I can also achieve some basic drawing and allow image zoom in/out with a mouse listener.
However I can't find a way to center the image into the displayed window.
Here is the sample code of the window part
#!/usr/bin/python3
import cv2
# Set screen resolution
resolution = (1920, 1080)
# Create window
cv2.namedWindow('Output')
cv2.resizeWindow("Output", resolution[0], resolution[1])
# Read and show image
inputImage = cv2.imread("stackoverflow.png")
cv2.imshow('Output', inputImage)
# Wait for keyboard input
chr = -1
while 0 < cv2.getWindowProperty("Output", cv2.WND_PROP_AUTOSIZE):
chr = cv2.waitKey(100)
Matplotlib does it quite well, it even resizes the printed image depending on window size.
I would like to implement something like that using opencv.
- Is that possible to implement such layouts with opencv
- Should I look for a window manager like GTK to achieve it ?

