diff options
Diffstat (limited to 'imagealgos.h')
| -rw-r--r-- | imagealgos.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/imagealgos.h b/imagealgos.h index b1efc87..bf5611a 100644 --- a/imagealgos.h +++ b/imagealgos.h @@ -7,6 +7,7 @@ constexpr size_t img_width = 1280; constexpr size_t img_height = 800; +constexpr uint32_t patternSize = 16; struct Image { @@ -18,12 +19,20 @@ struct Image unsigned int stride; libcamera::PixelFormat pixelFormat; float pixels[img_width]; + unsigned int measurementCounter; + uint64_t timestampNs; }; -size_t pgm_save(Image *img, FILE *outfile, bool really_save = true); +size_t pgm_save(Image *img, FILE *outfile, bool really_save = false); void unpack_10bit(uint8_t const *src, Image const &image, uint16_t *dest); void unpack_16bit(uint8_t const *src, Image const &image, uint16_t *dest); +template <typename T> +T median3(const T& a, const T& b, const T& c) { + using namespace std; + return max(min(a,b), min(max(a,b),c)); +} + void rotate(Image & image); void process_columns(Image & image); |
