Native host tool for LWIR lens and camera-mount calibration. More...
#include "version.h"#include <cstddef>#include <cstdio>#include <jpeglib.h>#include "jpeg_marker_guard.h"#include <setjmp.h>#include <opencv2/calib3d.hpp>#include <opencv2/core.hpp>#include <opencv2/core/persistence.hpp>#include <opencv2/imgproc.hpp>#include "opencv_parallel.hpp"#include <algorithm>#include <array>#include <cerrno>#include <cctype>#include <cmath>#include <cstdint>#include <filesystem>#include <fstream>#include <iomanip>#include <iostream>#include <memory>#include <set>#include <sstream>#include <stdexcept>#include <string>#include <sys/stat.h>#include <unistd.h>#include <vector>
Go to the source code of this file.
Macros | |
| #define | _POSIX_C_SOURCE 200809L |
| Request POSIX.1-2008 stream/descriptor APIs before system headers. | |
Functions | |
| int | main (int argc, char **argv) |
| Run one workshop stage with distinct invocation and fitting failures. | |
Detailed Description
Native host tool for LWIR lens and camera-mount calibration.
Lens mode estimates pinhole intrinsics and five Brown-Conrady distortion coefficients from varied checkerboard photographs. Mount mode holds those intrinsics fixed and estimates camera-to-body rotation from a board physically aligned with the aircraft datum. Keeping these stages separate avoids interpreting lens distortion as a mounting error.
OpenCV supplies detection, geometry and drawing; bundled libjpeg handles JPEG I/O so no OpenCV imgcodecs module or additional codec dependency is needed. Original pixels are neither resized nor EXIF-oriented before fitting: coefficients must describe the same native coordinates used by LWIRcam. Only inspection previews are enlarged and annotated.
Each run produces a runtime-readable profile, a diagnostic report and inspection previews. Failed runs remove the candidate profile but retain available diagnostic evidence. Outputs are intended for a trusted workshop directory, not concurrent writers competing for the same filenames.
- Warning
- Numerical convergence is not physical verification. Every exported profile remains unverified; corner orientation, board alignment and independent measurements must be checked before relying on projected coordinates.
- See also
- fit_lens
- fit_mount
Definition in file lwir_calibrate.cpp.
Macro Definition Documentation
◆ _POSIX_C_SOURCE
| #define _POSIX_C_SOURCE 200809L |
Request POSIX.1-2008 stream/descriptor APIs before system headers.
Definition at line 19 of file lwir_calibrate.cpp.
Function Documentation
◆ main()
| int main | ( | int | argc, |
| char ** | argv ) |
Run one workshop stage with distinct invocation and fitting failures.
- Parameters
-
argc Number of command-line arguments, including the executable name. argv Command-line arguments; help/version require no input files.
- Return values
-
0 Requested information or calibration artifacts were produced. 1 Calibration or I/O failed; available diagnostic evidence is retained. 2 Invocation or numeric argument parsing failed before output setup.
Failed processing removes the candidate profile so a partial result cannot masquerade as a usable calibration. Reports/previews stay available for diagnosis, and report-writing failure never hides the original error.
Definition at line 996 of file lwir_calibrate.cpp.