Get the pixels from X11 display and open the image in OpenCV window. Wayland yet to find out.
apt install libopencv-dev
Compile with -lX11
pkg-config --cflags --libs opencv4
Xlib provides better performance than pyautogui, PIL.ImageGrab or pyscreenshot.ImageGrab
pip install pillow
pip install python3-xlib