52 DllExport
void buildGraph(Size graphSize)
override;
53 DllExport
void setGraph(
const Mat& pots)
override;
66 DllExport
void addDefaultEdgesModel(
const Mat &featureVectors,
float val,
float weight = 1.0f)
override;
73 DllExport
void addDefaultEdgesModel(
const vec_mat_t &featureVectors,
float val,
float weight = 1.0f)
override;
87 DllExport
void setGraph(
const Mat &potBase,
const Mat &potOccl);
120 DllExport
void fillEdges(
const CTrainEdge &edgeTrainer,
const CTrainLink* linkTrainer,
const Mat &featureVectors,
const vec_float_t &vParams,
float edgeWeight = 1.0f,
float linkWeight = 1.0f);
133 DllExport
void fillEdges(
const CTrainEdge &edgeTrainer,
const CTrainLink* linkTrainer,
const vec_mat_t &featureVectors,
const vec_float_t &vParams,
float edgeWeight = 1.0f,
float linkWeight = 1.0f);
148 DllExport
void setEdges(std::optional<byte> group,
const Mat &pot);
CGraphLayeredExt(IGraphPairwise &graph, word nLayers, byte gType=GRAPH_EDGES_GRID)
Constructor.
virtual ~CGraphLayeredExt(void)=default
Links (inter-layer edges)
byte getType(void) const
Returns the type of the graph.
Vertical and horizontal edges.
graphEdgesType
Graph edges types.
void addFeatureVecs(CTrainEdge &edgeTrainer, const Mat &featureVectors, const Mat >)
Adds a block of new feature vectors.
void defineEdgeGroup(float A, float B, float C, byte group)
Assign the edges, which cross the given line to the grop group.
const word m_nLayers
Number of layers.
Base abstract class for edge potentials training.
Size m_size
Size of the graph.
Size getSize() const override
Returns the size of the graph.
void addDefaultEdgesModel(float val, float weight=1.0f) override
Adds default data-independet edge model.
Base abstract class for link (inter-layer edge) potentials training.
General graph extension abstract class for 2D image classifaction.
IGraphPairwise & getGraph(void) const
Returns the reference to the graph.
void buildGraph(Size graphSize) override
Builds a 2D graph of size corresponding to the image resolution.
void setGraph(const Mat &pots) override
Fills an existing 2D graph with potentials or builds a new 2D graph of size corresponding to pots...
Extended Pairwise Layered graph class.
IGraphPairwise & m_graph
The graph.
const byte m_gType
Graph type (Ref. graphEdgesType)
Interface class for graphical models.
void setEdges(std::optional< byte > group, const Mat &pot)
Sets potential pot to all edges in the group group.
void fillEdges(const CTrainEdge &edgeTrainer, const CTrainLink *linkTrainer, const Mat &featureVectors, const vec_float_t &vParams, float edgeWeight=1.0f, float linkWeight=1.0f)
Fills the graph edges with potentials.