|
CPPxDIC
C++ Digital Image Correlation library for fingertip 3D reconstruction
|
#include <mask_seed_setup.h>
Static Public Member Functions | |
| static MaskSeedResult | runGui (const cv::Mat &reference_image, int num_seeds, std::string &error_message) |
| Interactive GUI setup using OpenCV highgui. | |
| static MaskSeedResult | loadFromFiles (const std::string &polygon_or_mask_path, const std::string &seed_path, const cv::Size &image_size, std::string &error_message) |
| Non-interactive setup: load mask polygon (or mask image) and seed points from files. | |
| static bool | save (const MaskSeedResult &result, const std::string &out_prefix, std::string &error_message) |
| Persist a result to disk. | |
| static cv::Mat | polygonToMask (const std::vector< cv::Point > &polygon, const cv::Size &image_size) |
| Rasterise a polygon into an 8-bit (0/255) mask of the given size. | |
| static std::vector< cv::Point > | readPolygonFile (const std::string &path, std::string &error_message) |
| Read a ".poly" polygon file. | |
| static std::vector< SeedPoint > | readSeedFile (const std::string &path, std::string &error_message) |
| Read a ".seed" file. | |
| static bool | guiAvailable () |
| Returns true if this binary was compiled with GUI support. | |
Static helpers to create (GUI), load (non-GUI) and persist mask + seed data.
File formats (documented in README_xdic_stepsABC.md):
Definition at line 51 of file mask_seed_setup.h.
|
static |
Returns true if this binary was compiled with GUI support.
Definition at line 41 of file mask_seed_setup.cpp.
|
static |
Non-interactive setup: load mask polygon (or mask image) and seed points from files.
No window is created. This is the cluster path.
| polygon_or_mask_path | Path to a ".poly" polygon file OR an 8-bit mask image. |
| seed_path | Path to a ".seed" file. |
| image_size | Reference image size (used to rasterise the polygon). |
| error_message | Filled with a human readable message on failure. |
Definition at line 99 of file mask_seed_setup.cpp.
|
static |
Rasterise a polygon into an 8-bit (0/255) mask of the given size.
Definition at line 49 of file mask_seed_setup.cpp.
|
static |
Read a ".poly" polygon file.
Returns empty vector on error.
Definition at line 59 of file mask_seed_setup.cpp.
|
static |
Read a ".seed" file.
Returns empty vector on error.
Definition at line 79 of file mask_seed_setup.cpp.
|
static |
Interactive GUI setup using OpenCV highgui.
Opens a window on the reference image, lets the user draw a polygon MASK (left-click to add vertices, right-click / ENTER to close the polygon) and then pick one or more seed points. Only compiled when XDIC_STEPSABC_GUI is defined; otherwise returns an invalid result with an error message.
| reference_image | Reference image to draw on (grayscale or BGR). |
| num_seeds | Number of seed points to collect (>=1). |
| error_message | Filled with a human readable message on failure. |
Definition at line 290 of file mask_seed_setup.cpp.
|
static |
Persist a result to disk.
Writes <out_prefix>.poly, <out_prefix>_mask.png and <out_prefix>.seed. Returns false (and sets error_message) on I/O error.
Definition at line 141 of file mask_seed_setup.cpp.