Brian Silverman | 6ae77dd | 2013-03-29 22:28:08 -0700 | [diff] [blame] | 1 | |
| 2 | #ifndef _SENSOR_PROCESSOR_H_ |
| 3 | #define _SENSOR_PROCESSOR_H_ |
| 4 | |
| 5 | // struct maps a single point x to to a value f of x |
| 6 | typedef struct { |
| 7 | double x; |
| 8 | double fx; |
| 9 | } Interpolation; |
| 10 | |
| 11 | // a set of mapping to use to determine distance |
| 12 | // in inches given a pixel offset |
| 13 | const Interpolation pixel_to_dist[4] = { |
| 14 | {43.0, 495.0}, |
| 15 | {98.0, 260.0}, |
| 16 | {145.75, 174.0}, |
| 17 | {216.75, 110.0}}; |
| 18 | const Interpolation pixel_to_dist640x480[4] = { |
| 19 | {86.0, 495.0}, |
| 20 | {196.0, 260.0}, |
| 21 | {291.5, 176.0}, |
| 22 | {433.5, 110.0}}; |
| 23 | |
| 24 | double interpolate(int num_interp_vals, |
| 25 | const Interpolation *interp, double value); |
| 26 | |
| 27 | #endif //_SENSOR_PROCESSOR_H_ |
| 28 | |