CppNCorr
C++ ncorr Digital Image Correlation engine
Loading...
Searching...
No Matches
frame_reader.h File Reference

Image-folder frame discovery helpers for the file-based DIC pipeline. More...

#include <algorithm>
#include <cctype>
#include <cerrno>
#include <cstring>
#include <stdexcept>
#include <string>
#include <vector>
#include <dirent.h>
#include <sys/stat.h>

Go to the source code of this file.

Namespaces

namespace  ncorr
 

Functions

const std::vector< std::string > & ncorr::image_extensions ()
 Supported image extensions (lowercase, including the leading dot).
 
bool ncorr::has_image_extension (const std::string &lower_name)
 Test whether a (lowercased) filename ends with a supported image extension.
 
bool ncorr::natural_less (const std::string &a, const std::string &b)
 Natural (human) ordering comparison for filenames.
 
std::vector< std::string > ncorr::discover_frames (const std::string &folder, const std::string &ref_path, const std::string &roi_path)
 Discover the deformed-frame image files inside folder.
 

Detailed Description

Image-folder frame discovery helpers for the file-based DIC pipeline.

These helpers were extracted out of proxyncorr.cpp so they can be reused and unit-tested in isolation without compiling the whole driver. The behaviour is intentionally identical to the original in-driver implementation.

NAMING CONVENTION / EXPECTED LAYOUT (see discover_frames):

  • One image per frame, plus (optionally) a ROI mask and a dedicated reference image.
  • Frames numbered so they sort in acquisition order. Both zero-padded ("frame_00.png", "frame_01.png", ...) and unpadded ("frame_2.png", "frame_10.png", ...) numbering work; ordering uses a natural (numeric-aware) comparison, not raw lexicographic order.
  • Files named "roi.png" and "ref.png" (case-insensitive) are reserved and excluded, as are files matching the supplied ref_path / roi_path basenames.
  • Hidden files (leading '.') and non-image extensions are ignored.
  • Supported extensions: .png .tif .tiff .bmp .jpg .jpeg

The functions are inline so this header is self-contained: tests can include it directly without linking the driver translation unit.

Definition in file frame_reader.h.