summaryrefslogtreecommitdiff
path: root/imagealgos.h
diff options
context:
space:
mode:
authorNikita Kostovsky <luntik2012@gmail.com>2024-12-02 19:42:15 +0100
committerNikita Kostovsky <luntik2012@gmail.com>2024-12-02 19:42:15 +0100
commit5e6df9ccf832d166bd231297b521394beec1fec6 (patch)
tree73b38c20f836de769fbe0c5304b20d5096f985bf /imagealgos.h
parent53979d9d26c5bb51e86e70eb9c3a998bc50f713c (diff)
line search
Diffstat (limited to 'imagealgos.h')
-rw-r--r--imagealgos.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/imagealgos.h b/imagealgos.h
index 77ac625..12dc8cf 100644
--- a/imagealgos.h
+++ b/imagealgos.h
@@ -6,6 +6,9 @@
#include <libcamera/pixel_format.h>
+#include <QLineF>
+#include <QList>
+
constexpr size_t img_width = 1280;
constexpr size_t img_height = 800;
constexpr uint32_t patternSize = 16;
@@ -37,8 +40,12 @@ struct Pixels
{
Counters counters {};
std::array<float, img_width> pixels { 0.f };
+
+ Pixels& operator+=(const Pixels& other);
+ Pixels& operator/=(const float divider);
};
+
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);
@@ -52,3 +59,6 @@ T median3(const T& a, const T& b, const T& c) {
void rotate(Image & image);
Pixels process_columns(Image & image);
+
+QList<QLineF> pixelsToLines(const Pixels& rawProfile);
+QList<QLineF> pointsToLines(const QList<QPointF>& points);