![]() |
Direct Graphical Models
v.1.7.0
|
Extended Dense graph class for 2D image classifaction. More...
#include <GraphDenseExt.h>
Public Member Functions | |
CGraphDenseExt (CGraphDense &graph) | |
Constructor. More... | |
~CGraphDenseExt (void)=default | |
void | buildGraph (Size graphSize) override |
Builds a 2D graph of size corresponding to the image resolution. More... | |
void | setGraph (const Mat &pots) override |
Fills an existing 2D graph with potentials or builds a new 2D graph of size corresponding to pots.size() with potentials. More... | |
void | addDefaultEdgesModel (float val, float weight=1.0f) override |
Adds default data-independet edge model. More... | |
void | addDefaultEdgesModel (const Mat &featureVectors, float val, float weight=1.0f) override |
Adds default contrast-sensitive edge model. More... | |
void | addDefaultEdgesModel (const vec_mat_t &featureVectors, float val, float weight=1.0f) override |
Adds default contrast-sensitive edge model. More... | |
Size | getSize (void) const override |
Returns the size of the graph. More... | |
void | addGaussianEdgeModel (Vec2f sigma, float weight=1.0f, const std::function< void(const Mat &src, Mat &dst)> &semiMetricFunction={}) |
Add a Gaussian potential model with standard deviation sigma. More... | |
void | addBilateralEdgeModel (const Mat &featureVectors, Vec2f sigma, float sigma_opt=1.0f, float weight=1.0f, const std::function< void(const Mat &src, Mat &dst)> &semiMetricFunction={}) |
Add a Bilateral pairwise potential with spacial standard deviations sigma and color standard deviations sr,sg,sb. More... | |
void | addBilateralEdgeModel (const vec_mat_t &featureVectors, Vec2f sigma, float sigma_opt=1.0f, float weight=1.0f, const std::function< void(const Mat &src, Mat &dst)> &semiMetricFunction={}) |
Add a Bilateral pairwise potential with spacial standard deviations sx, sy and color standard deviations sr,sg,sb. More... | |
![]() | |
CGraphExt (void)=default | |
CGraphExt (const CGraphExt &)=delete | |
virtual | ~CGraphExt (void)=default |
const CGraphExt & | operator= (const CGraphExt &)=delete |
Private Attributes | |
CGraphDense & | m_graph |
The graph. More... | |
Size | m_size |
Size of the 2D graph. More... | |
Extended Dense graph class for 2D image classifaction.
This graph class provides simplified interface and additional functionality, when the graph is used for 2D image classification
Definition at line 17 of file GraphDenseExt.h.
|
inline |
|
default |
void DirectGraphicalModels::CGraphDenseExt::addBilateralEdgeModel | ( | const Mat & | featureVectors, |
Vec2f | sigma, | ||
float | sigma_opt = 1.0f , |
||
float | weight = 1.0f , |
||
const std::function< void(const Mat &src, Mat &dst)> & | semiMetricFunction = {} |
||
) |
Add a Bilateral pairwise potential with spacial standard deviations sigma and color standard deviations sr,sg,sb.
featureVectors | Multi-channel matrix, each element of which is a multi-dimensinal point: Mat(type: CV_8UC<nFeatures>) |
sigma | The spatial standard deviation of the 2D-bilateral filter |
sigma_opt | The standard deviation for featureVectors |
weight | The weighting parameter |
semiMetricFunction | Reference to a semi-metric function, which arguments src and dst are: Mat(size: 1 x nFeatures; type: CV_32FC1). For more details refere to CEdgeModelPotts. |
Definition at line 47 of file GraphDenseExt.cpp.
void DirectGraphicalModels::CGraphDenseExt::addBilateralEdgeModel | ( | const vec_mat_t & | featureVectors, |
Vec2f | sigma, | ||
float | sigma_opt = 1.0f , |
||
float | weight = 1.0f , |
||
const std::function< void(const Mat &src, Mat &dst)> & | semiMetricFunction = {} |
||
) |
Add a Bilateral pairwise potential with spacial standard deviations sx, sy and color standard deviations sr,sg,sb.
featureVectors | Multi-channel matrix, each element of which is a multi-dimensinal point: Mat(type: CV_8UC<nFeatures>) |
sigma | The spatial standard deviation of the 2D-bilateral filter |
sigma_opt | The standard deviation for featureVectors |
weight | The weighting parameter |
semiMetricFunction | Reference to a semi-metric function, which arguments src and dst are: Mat(size: 1 x nFeatures; type: CV_32FC1). For more details refere to CEdgeModelPotts. |
Definition at line 68 of file GraphDenseExt.cpp.
|
inlineoverridevirtual |
Adds default data-independet edge model.
This function adds a Gaussian edge model to the dense CRF model
val | Value, specifying the smoothness strength - in this case the spatial standard deviation of the 2D-Gaussian filter scaled by 33.(3) |
weight | The weighting parameter |
Implements DirectGraphicalModels::CGraphExt.
Definition at line 36 of file GraphDenseExt.h.
|
inlineoverridevirtual |
Adds default contrast-sensitive edge model.
This function adds a Bilateral edge model to the dense CRF model
featureVectors | Multi-channel matrix, each element of which is a multi-dimensinal point: Mat(type: CV_8UC<nFeatures>) |
val | Value, specifying the smoothness strength - in this case the spatial standard deviation of the 2D-bilateral filter scaled by 33.(3) |
weight | The weighting parameter |
Implements DirectGraphicalModels::CGraphExt.
Definition at line 47 of file GraphDenseExt.h.
|
inlineoverridevirtual |
Adds default contrast-sensitive edge model.
This function adds a Bilateral edge model to the dense CRF model
featureVectors | Vector of size nFeatures, each element of which is a single feature - image: Mat(type: CV_8UC1) |
val | Value, specifying the smoothness strength - in this case the spatial standard deviation of the 2D-bilateral filter scaled by 33.(3) |
weight | The weighting parameter |
Implements DirectGraphicalModels::CGraphExt.
Definition at line 58 of file GraphDenseExt.h.
void DirectGraphicalModels::CGraphDenseExt::addGaussianEdgeModel | ( | Vec2f | sigma, |
float | weight = 1.0f , |
||
const std::function< void(const Mat &src, Mat &dst)> & | semiMetricFunction = {} |
||
) |
Add a Gaussian potential model with standard deviation sigma.
sigma | The spatial standard deviation of the 2D-Gaussian filter |
weight | The weighting parameter |
semiMetricFunction | Reference to a semi-metric function, which arguments src and dst are: Mat(size: 1 x nFeatures; type: CV_32FC1). For more details refere to CEdgeModelPotts. |
Definition at line 32 of file GraphDenseExt.cpp.
|
overridevirtual |
Builds a 2D graph of size corresponding to the image resolution.
When called multiple times, previouse graph structure is always replaced
graphSize | The size of the graph (image resolution) |
Implements DirectGraphicalModels::CGraphExt.
Definition at line 8 of file GraphDenseExt.cpp.
|
inlineoverridevirtual |
Returns the size of the graph.
Implements DirectGraphicalModels::CGraphExt.
Definition at line 62 of file GraphDenseExt.h.
|
overridevirtual |
Fills an existing 2D graph with potentials or builds a new 2D graph of size corresponding to pots.size() with potentials.
If the graph was not build beforehand, or the size of existing graph does not correspond to pots.size() this function calls first
pots | A block of node potentials: Mat(size: image width x image height; type: CV_32FC(nStates)). It may be obtained by: |
Implements DirectGraphicalModels::CGraphExt.
Definition at line 20 of file GraphDenseExt.cpp.
|
private |
The graph.
Definition at line 96 of file GraphDenseExt.h.
|
private |
Size of the 2D graph.
Definition at line 97 of file GraphDenseExt.h.