Created
October 3, 2020 16:33
-
-
Save Kunzendorf/0ed42a0c8f3e657e4dcb2ea90be3e3af to your computer and use it in GitHub Desktop.
PYNQ HDMI input test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pynq.overlays.base import BaseOverlay | |
from pynq.lib.video import * | |
base = BaseOverlay("base.bit") | |
hdmi_in = base.video.hdmi_in | |
hdmi_out = base.video.hdmi_out | |
hdmi_in.configure() | |
hdmi_out.configure(hdmi_in.mode) | |
hdmi_in.start() | |
hdmi_out.start() | |
import PIL.Image | |
frame = hdmi_in.readframe() | |
img = PIL.Image.fromarray(frame) | |
img.save("/home/xilinx/jupyter_notebooks/base/video/data/test_pic.jpg") | |
hdmi_out.stop() | |
hdmi_in.stop() | |
del hdmi_in, hdmi_out | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment