diff --git a/README.md b/README.md new file mode 100644 index 0000000..107f64e --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# Profilometer + +This project aims to create a library of functions for laser line profilometry using a generic image capture device, as well as an end-user program built on this library. + +Tasks: +- [ ] Documentation + - [ ] Mathematical problem description + - [ ] Library documentation + - [ ] Program manual +- [ ] Library + - [ ] Configuration loading + - [ ] Image loading + - [ ] Image parsing + - [ ] Incidence point detection + - [ ] Real space position calculation + - [ ] Curvature correction + - [ ] Output drawing +- [ ] End-user program + - [ ] Base functionality + - [ ] Basic GUI + - [ ] Config creation with GUI \ No newline at end of file diff --git a/doc/fig_1.png b/doc/fig_1.png new file mode 100644 index 0000000..a76904b Binary files /dev/null and b/doc/fig_1.png differ diff --git a/doc/fig_2.png b/doc/fig_2.png new file mode 100644 index 0000000..22a82b8 Binary files /dev/null and b/doc/fig_2.png differ diff --git a/doc/pm_doc.pdf b/doc/pm_doc.pdf new file mode 100644 index 0000000..32fb83f Binary files /dev/null and b/doc/pm_doc.pdf differ diff --git a/pmlib.cpp b/pmlib.cpp new file mode 100644 index 0000000..8c2ad34 --- /dev/null +++ b/pmlib.cpp @@ -0,0 +1,53 @@ + +#define _USE_MATH_DEFINES +#include +#include +//#include +#include +#include +#include + +using namespace cv; +using namespace std; + + +// Geometry conversion functions + +// Frame parser functions + +void fp_brute_force(Mat* img, int* max_row_arr){ + // Process all columns sequentially +} + +// Column search functions + +int cs_full_col_max(Mat* img, int col) { + // Brute force search entire column for brightest pixel + int maxrow = 0; + int maxbr = 0; + for (int row = 0; row < (* img).rows; row++) { + Vec3b& px = (* img).at(row, col); + if (px[0] + px[1] + px[2] > maxbr) { + maxbr = px[0] + px[1] + px[2]; + maxrow = row; + } + } + return maxrow; +} + +int cs_neigh_thres_max(Mat* img, int col, int last_max_row, int thres, int range) { + // Thresholded search within {range} pixels of {last_max_row}, if not found do brute force + return 0; +} + +int cs_thres_center(Mat* img, int col, int last_max_row, int thres) { + // Find range around {last_max_row} above {thres}, return center pixel of range + return 0; +} + +int cs_thres_median(Mat* img, int col, int last_max_row, int thres) { + // Find range around {last_max_row} above {thres}, return median pixel of range + return 0; +} + +// Curvature correction functions \ No newline at end of file