In this notebook, we will demonstrate how to use the motion blur filter. This filter shows that partially reconfigurable modules can use Xilinx IP cores. This filter blurs the video feed horizontally. The length of the blur is determined by a register in the module. This register is controlled by a python slide widget.
In [1]:
from pynq.drivers.video import HDMI
from pynq import Bitstream_Part
from pynq.board import Register
from pynq import Overlay
Overlay("demo.bit").download()
In [2]:
hdmi_in = HDMI('in')
hdmi_out = HDMI('out', frame_list=hdmi_in.frame_list)
hdmi_out.mode(2)
hdmi_out.start()
hdmi_in.start()
In [3]:
Bitstream_Part("motion_p.bit").download()
In [5]:
import ipywidgets as widgets
R0 =Register(0)
R0.write(255)
R0_s = widgets.IntSlider(
value=255,
min=0,
max=511,
step=1,
description='Blur:',
disabled=False,
continuous_update=True,
orientation='vertical',
readout=True,
readout_format='i',
slider_color='red'
)
def update_r0(*args):
R0.write(R0_s.value)
R0_s.observe(update_r0, 'value')
widgets.HBox([R0_s])
In [6]:
hdmi_out.stop()
hdmi_in.stop()
del hdmi_out
del hdmi_in