Direct Graphical Models  v.1.7.0
VIS Module

Classes

class  DirectGraphicalModels::vis::CMarker
 Marker class. More...
 
class  DirectGraphicalModels::vis::CMarkerHistogram
 Histogram Marker class. More...
 

Functions

Mat DirectGraphicalModels::vis::drawDictionary (const Mat &dictionary, double m=1)
 Visualizes a sparse coding dictionary. More...
 
Mat DirectGraphicalModels::vis::drawGraph (int size, IGraphPairwise &graph, std::function< Point2f(size_t)> posFunc, std::function< cv::Scalar(size_t)> colorFunc=nullptr, const vec_scalar_t &groupsColor=vec_scalar_t())
 Visualizes the graph structure. More...
 
void DirectGraphicalModels::vis::showGraph3D (int size, IGraphPairwise &graph, std::function< Point3f(size_t)> posFunc, std::function< cv::Scalar(size_t)> colorFunc=nullptr, const vec_scalar_t &groupsColor=vec_scalar_t())
 Visualizes the graph structure in 3D. More...
 

Detailed Description

Visualization Module

Marker module provides with a variety of tools for visualizing and analyzing used data as well as intermediate and final results:

For user interaction capacity, there are more functions, which allow for handling the mouse clicks over the figures. Please see our tutorial Demo Visualization for more details.

Author
Sergey G. Kosov, serge.nosp@m.y.ko.nosp@m.sov@p.nosp@m.roje.nosp@m.ct-10.nosp@m..de

Function Documentation

◆ drawDictionary()

Mat DirectGraphicalModels::vis::drawDictionary ( const Mat &  dictionary,
double  m = 1 
)

Visualizes a sparse coding dictionary.

This function visualizes a dictionary, that is returned by fex::CSparseDictionary::getDictionary() fucntion

Parameters
dictionaryDictionary: Mat of type: CV_64FC1
mThe magnifier koefficients for scaling the dictionary values
Returns
Figure with visualized dictionary

Definition at line 324 of file Marker.cpp.

◆ drawGraph()

Mat DirectGraphicalModels::vis::drawGraph ( int  size,
IGraphPairwise graph,
std::function< Point2f(size_t)>  posFunc,
std::function< cv::Scalar(size_t)>  colorFunc = nullptr,
const vec_scalar_t &  groupsColor = vec_scalar_t() 
)

Visualizes the graph structure.

Parameters
sizeThe size of resulting image
graphThe graph
posFuncThe positioning function: a mapper, that defines spacial position at the canvas for every graph node. The coordinates must lie in range [-1; 1].
For example:
Point2f posFunc(size_t nodeId) {
return Point2f(
0.9f * cosf(2 * n * Pif / nNodes),
0.9f * sinf(2 * n * Pif / nNodes)
);
});
colorFuncThe color function: a mapper, that defines color (CV_RGB(r, g, b)) for every graph node.
groupsColorThe list of colors for graph edge groups.
Returns
Image size x size pixels with visualized graph.

Definition at line 76 of file MarkerGraph.cpp.

Here is the call graph for this function:

◆ showGraph3D()

void DirectGraphicalModels::vis::showGraph3D ( int  size,
IGraphPairwise graph,
std::function< Point3f(size_t)>  posFunc,
std::function< cv::Scalar(size_t)>  colorFunc = nullptr,
const vec_scalar_t &  groupsColor = vec_scalar_t() 
)

Visualizes the graph structure in 3D.

This function creates an OpenGL window with the visualized graph, seen from a trackball camera. User may rotate, zoom, pan and centralize the visualized graph.

In order to use this function, OpenGL must be built with the USE_OPENGL flag

Parameters
sizeThe size of the viewing window (size x size pixels)
graphThe graph
posFuncThe positioning function: a mapper, that defines spacial position in 3D world for every graph node. For better wieving expierence, the coordinates should lie in range [-0.5; 0.5].
For example:
Point3f posFunc(size_t nodeId) {
return Point3f(
0.9f * cosf(2 * n * Pif / nNodes),
0.9f * sinf(2 * n * Pif / nNodes),
static_cast<float>(n) / nNodes
);
});
colorFuncThe color function: a mapper, that defines color (CV_RGB(r, g, b)) for every graph node.
groupsColorThe list of colors for graph edge groups.

Definition at line 322 of file MarkerGraph.cpp.

Here is the call graph for this function: