#include <dv-processing/data/generate.hpp>
#include <dv-processing/noise/frequency_filters.hpp>

#include <opencv2/highgui.hpp>

int main() {
	using namespace std::chrono_literals;

	const cv::Size resolution(200, 200);
	const float frequency = 2000.0f;

	// Initializing 10000 events that are uniformly spaced in pixel area and time
	dv::EventStore events = dv::data::generate::uniformEventsWithinTimeRange(
		0, dv::Duration(static_cast<int64_t>(1e6f / frequency)), resolution, 10000);

	// Initialize low-pass frequency filter with given cutoff frequency
	dv::noise::LowPassFilter filter(resolution, frequency);

	// Pass events to the filter
	filter.accept(events);

	// Call generate events to apply the filter
	const dv::EventStore filtered = filter.generateEvents();

	// Print out the number of events after filtering
	std::cout << "Filtered [" << filtered.size() << "] events out of [" << events.size() << "]" << std::endl;

	return 0;
}
