import dv_processing as dv
import cv2 as cv
from datetime import timedelta

resolution = (200, 200)
frequency = 2000
# Initializing 10000 events that are uniformly spaced in pixel area and time
events = dv.data.generate.uniformEventsWithinTimeRange(0, timedelta(milliseconds=1e3 / frequency), resolution, 10000)

# Initialize low-pass frequency filter with given cutoff frequency
filter = dv.noise.LowPassFilter(resolution, frequency)

# Pass events to the filter
filter.accept(events)

# Call generate events to apply the filter
filtered = filter.generateEvents()

# Print out the number of events after filtering
print(f"Filtered [{len(filtered)}] events ouf of [{len(events)}]")
