Unlike conventional cameras, which generate a stream of images, event-based cameras generate a stream of timestamped events carrying pixel coordinates where changes of luminosity happened:
struct Event {
int x, y; //position unsigned long long t; //timestamp
};
In practice, the event stream is typically sliced in successive buffers of events for further processing and stored in standard vectors:
std::vector buffer;
Real processing pipelines often need to apply different algorithms on the same input buffers and merge their results later in the processing chain. The goal of this exercise is to write a function taking as input two event buffers, both assumed to be ordered chronologically, and returning the merged event buffer still ordered chronologically:
void chronological_merge(const std::vector& input1, const std::vector& input2, std::vector& output) {
// TODO
}
As an example, if input1 = {([0,0],0), ([1,0],2)} and input2 = {([0,1],1)}, then the expected output is output={([0,0],0), ([0,1],1), ([1,0],2)}.
To simplify, you can assume that all input events have different timestamps (i.e. there is no duplicate timestamps in the input events) and that the output vector is initially empty.