diff options
| author | Nikita Kostovsky <nikita@kostovsky.me> | 2025-01-23 15:49:39 +0100 |
|---|---|---|
| committer | Nikita Kostovsky <nikita@kostovsky.me> | 2025-01-23 15:49:39 +0100 |
| commit | 459fe70f53b2f3a7dc33c3833210f60840a23204 (patch) | |
| tree | b670c6fe344e499affad0334491ddeaa26d102e0 /main.cpp | |
| parent | 80949709a1132b5198bb8006963f177fcde2e991 (diff) | |
change img data type to uint8_t, fix loading of bin calibration table
Diffstat (limited to 'main.cpp')
| -rw-r--r-- | main.cpp | 22 |
1 files changed, 19 insertions, 3 deletions
@@ -110,6 +110,12 @@ void onNewPixels( // qDebug() << __func__ << "got empty pixels"; } + for (size_t i = 640 - 5; i < 640 + 5; i++) { + // std::cout << pixels->pixels[i] << " "; + } + + // std::cout << std::endl + ::pixels = *pixels; } @@ -144,7 +150,7 @@ int main(int argc, char* argv[]) // if (false) qDebug() << "size of raw profile" << sizeof(Pixels); - if (false) { + if (true) { // open binary calibration table if (true) { if (!openCalibrationTable("/home/user/dumps/binz.calibration_table", @@ -294,8 +300,7 @@ int main(int argc, char* argv[]) interpolate(::calibrationTableX); - if (!dump(::calibrationTableZ, - "/home/user/dumps/binx.calibration_table")) { + if (!dump(::calibrationTableX, "/home/user/dumps/binx.calibration_table")) { qApp->exit(EXIT_FAILURE); } @@ -305,6 +310,14 @@ int main(int argc, char* argv[]) } } + QCryptographicHash hashZ(QCryptographicHash::Sha256); + hashZ.addData(QByteArrayView((char *) ::calibrationTableZ.data(), sizeof(CalibrationTable))); + qDebug() << "hash z" << sizeof(::calibrationTableZ) << hashZ.result().toHex(); + + QCryptographicHash hashX(QCryptographicHash::Sha256); + hashX.addData(QByteArrayView((char *) ::calibrationTableX.data(), sizeof(CalibrationTable))); + qDebug() << "hash x" << sizeof(::calibrationTableX) << hashX.result().toHex(); + // exit(EXIT_SUCCESS); // if (!initLaser()) { @@ -353,7 +366,10 @@ int main(int argc, char* argv[]) QHttpServer qHttpServer; qHttpServer.route("/v1/sensor/image", [&]() { std::cout << "http: image" << std::endl << std::flush; + // FILE *f = fopen("/tmp/img.pgm", "w"); + // static bool save = false; pgm_save(::img); + // save = false; std::lock_guard<std::mutex> lg(pgm_image_mtx); qDebug() << "mutex locked"; qDebug() << "image saved to array"; |
