Repository navigation
Expand file tree
/
Copy pathconfig.hpp
More file actions
96 lines (84 loc) · 4.13 KB
/
Copy pathconfig.hpp
File metadata and controls
96 lines (84 loc) · 4.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#pragma once
#include <string>
#include <vector>
/** Configuration for the Canny edge detector. */
struct CannyConfig {
double lowThreshold = 100; ///< lower hysteresis threshold
double highThreshold = 150; ///< upper hysteresis threshold
int apertureSize = 3; ///< Sobel aperture size
bool L2gradient = false; ///< use more accurate L2 norm
};
/** Configuration for the probabilistic Hough transform. */
struct HoughConfig {
double rho = 1; ///< distance resolution of the accumulator
double theta = 0.01745; ///< angle resolution in radians (e.g. CV_PI/180)
int threshold = 50; ///< accumulator threshold
double minLineLength = 50; ///< minimum line length
double maxLineGap = 10; ///< maximum allowed gap between points
};
/** Parameters for computing the angle histogram. */
struct HistogramConfig {
int resolution = 90; ///< number of histogram bins
int windowHalfSize = 2; ///< half window size for moving average
};
/**
* Configuration for the alignment pipeline. Preprocessing (binarisation,
* cropping, etc.) is expected to be done outside of this class.
*/
struct AlignmentConfig {
bool enable = true; ///< enable alignment stage
CannyConfig cannyConfig; ///< parameters for Canny
HoughConfig houghConfig; ///< parameters for Hough transform
HistogramConfig histogramConfig; ///< histogram parameters
};
/** Configuration for the denoising stage (generate_denoised_alone). */
struct DenoiseConfig {
double binaryForCropThreshold = 0.2; ///< threshold for cropping mask
double binaryThreshold = 0.2; ///< threshold for noise removal
double compOutMinAreaM2 = 1.0; ///< minimal size of outer components (m^2)
double compInMinAreaM2 = 1.0; ///< minimal size of inner components (m^2)
double rankBinaryThreshold = 0.9; ///< final binarisation threshold
};
/** Configuration for dilation. */
struct DilateConfig {
int kernelSize = 3; ///< kernel size for dilation
int iterations = 1; ///< number of iterations
};
/** Configuration for ridge map generation. */
struct RidgeConfig {
std::string mode = ""; ///< generation mode
std::vector<double> sigmas = {1.0, 2.0, 3.0}; ///< list of scales
};
/** Parameters used for computing the label list. */
struct LabelsListConfig {
double sigmaStart = 1.0; ///< starting sigma
double sigmaStep = 0.2; ///< step between sigma values
double gaussianSeedsThreshold = 0.05; ///< threshold for seeds
int maxIter = 1; ///< number of iterations
int backgroundErosionKernelSize = 3; ///< erosion kernel size
bool debug = true; ///< enable debug output
};
/** Configuration for the over-segmentation stage. */
struct OverSegmentConfig {
// Additional parameters for map_initial_seeds or final watershed can be
// added here.
};
/** Configuration for node merging stage. */
struct MergeNodesConfig {
double areaThreshold = 10.0; ///< merge zones smaller than this area
};
/** Configuration for edge merging stage. */
struct MergeEdgesConfig {
double lengthThreshold; ///< merge edges shorter than this length
};
/** Combined configuration for the full segmentation pipeline. */
struct SegmenterConfig {
AlignmentConfig alignmentConfig; ///< alignment parameters
DenoiseConfig denoiseConfig; ///< denoising parameters
DilateConfig dilateConfig; ///< dilation parameters
RidgeConfig ridgeConfig; ///< ridge map parameters
LabelsListConfig labelsListConfig; ///< label list computation
OverSegmentConfig overSegmentConfig; ///< over-segmentation parameters
MergeNodesConfig mergeNodesConfig; ///< node merge parameters
MergeEdgesConfig mergeEdgesConfig; ///< edge merge parameters
};