17#ifndef STEPSABC_MASK_SEED_SETUP_H
18#define STEPSABC_MASK_SEED_SETUP_H
21#include <opencv2/opencv.hpp>
67 std::string& error_message);
80 const std::string& seed_path,
const cv::Size& image_size,
81 std::string& error_message);
88 std::string& error_message);
91 static cv::Mat
polygonToMask(
const std::vector<cv::Point>& polygon,
const cv::Size& image_size);
95 std::string& error_message);
98 static std::vector<SeedPoint>
readSeedFile(
const std::string& path, std::string& error_message);
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 MaskSeedResult runGui(const cv::Mat &reference_image, int num_seeds, std::string &error_message)
Interactive GUI setup using OpenCV highgui.
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 bool save(const MaskSeedResult &result, const std::string &out_prefix, std::string &error_message)
Persist a result to disk.
DataSerializer - Abstract base class for format-agnostic DIC data I/O.
Result of a mask/seed setup operation.
std::vector< cv::Point > polygon
std::vector< SeedPoint > seeds