|Data reading and fusion|
Each controller of the cylindrical CURVACE sensor transmits only a part of the whole sensor data with a small overlap. The bottom controller reads columns 1 to 22 and the top controller reads columns 21 to 42.
With each column containing 15 ommatidia each controller transmits rowise a frame of 15x22 values. Each value is encoded in 2 bytes and contains the 10bit output of the corresponsing ommatidium.
On the readout controller we store the data in a single data structure of 42x15 entries. To simplify the readout and data fusion process the mapping from both sensor frames to this data structure is precomputed. These mappings are stored in two arrays top and bottom such that top[i] points to the location of the first entry of the i'th line of the top frame.
The readout procedure first reads all data from the bottom controller and then the data from the top controller. In this simple case the data from the top controller overwrite the data from the bottom controller at columns 21 and 22. This avoids introducing additional special cases. The following pseudo code illustrates the process.
for y = 0 to 14 : for x = 0 to 21 : bot[y][x] = receive_SPI_data_bottom()
for y = 0 to 14 : for x = 0 to 21 : top[y][x] = receive_SPI_data_top()