Direct Graphical Models  v.1.7.0
DirectGraphicalModels::vis::CMarker Class Reference

Marker class. More...

#include <Marker.h>

Inheritance diagram for DirectGraphicalModels::vis::CMarker:
Collaboration diagram for DirectGraphicalModels::vis::CMarker:

Public Member Functions

 CMarker (default_pallete palette=DEF_PALETTE_12)
 Constructor with a default palette. More...
 
 CMarker (const vec_nColor_t &vPalette)
 Constructor with a custom palette. More...
 
virtual ~CMarker (void)
 
void markClasses (Mat &base, const Mat &classes, byte flag=0) const
 Visualizes the classes. More...
 
Mat drawPotentials (const Mat &potential, byte flag=0) const
 Visualizes the potentials. More...
 
Mat drawConfusionMatrix (const Mat &confusionMat, byte flag=0) const
 Visualizes a confusion matrix. More...
 

Protected Attributes

vec_nColor_t m_vPalette
 Pointer to the container with the palette. More...
 

Private Types

enum  textProp {
  TP_CENTER = 0, TP_LEFT = 1, TP_RIGHT = 2, TP_TOP = 4,
  TP_BOTTOM = 8, TP_PERCENT = 128
}
 

Private Member Functions

Mat drawVector (const Mat &potential, byte flag) const
 
Mat drawMatrix (const Mat &potential, byte flag) const
 
Mat drawVoxel (const Mat &potential, byte flag) const
 
template<typename T >
void drawSquare (Mat &img, byte x, byte y, const Scalar &color, T val, double fontScale=1.0, byte textProp=0) const
 
void drawRectangle (Mat &img, Point pt1, Point pt2, const Scalar &color, float val, double fontScale=1.0, byte textProp=TP_CENTER) const
 
void drawRectangle (Mat &img, Point pt1, Point pt2, const Scalar &color, const std::string &str=std::string(), double fontScale=1.0, byte textProp=TP_CENTER) const
 
 CMarker (const CMarker &)=delete
 
const CMarkeroperator= (const CMarker &)=delete
 

Static Private Attributes

static const byte bkgIntencity = 222
 
static const byte frgIntensity = 255
 
static const int ds = 70
 

Detailed Description

Marker class.

This class allows to visualize the results of graphical models decoding

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

Definition at line 78 of file Marker.h.

Member Enumeration Documentation

◆ textProp

Enumerator
TP_CENTER 
TP_LEFT 
TP_RIGHT 
TP_TOP 
TP_BOTTOM 
TP_PERCENT 

Definition at line 80 of file Marker.h.

Constructor & Destructor Documentation

◆ CMarker() [1/3]

DirectGraphicalModels::vis::CMarker::CMarker ( default_pallete  palette = DEF_PALETTE_12)

Constructor with a default palette.

Parameters
paletteOne of the default palletes (Ref. default_pallete).

Definition at line 14 of file Marker.cpp.

Here is the call graph for this function:

◆ CMarker() [2/3]

DirectGraphicalModels::vis::CMarker::CMarker ( const vec_nColor_t vPalette)

Constructor with a custom palette.

Parameters
vPaletteCustom palette. It is represented as a std::vector of the custom entries of type:
std::make_pair(CV_RGB(r, g, b), "class name").
For optimal performance, class name should have maximal 10 symbols.

Definition at line 34 of file Marker.cpp.

◆ ~CMarker()

DirectGraphicalModels::vis::CMarker::~CMarker ( void  )
virtual

Definition at line 38 of file Marker.cpp.

◆ CMarker() [3/3]

DirectGraphicalModels::vis::CMarker::CMarker ( const CMarker )
privatedelete

Member Function Documentation

◆ drawConfusionMatrix()

Mat DirectGraphicalModels::vis::CMarker::drawConfusionMatrix ( const Mat &  confusionMat,
byte  flag = 0 
) const

Visualizes a confusion matrix.

This function visualizes a confusion matrix, where gthe values are given in percents ofthe overall number of estimated samples. The function additionally computes and visualizes the recall and precision values for each class. If the flag MARK_PERCLASS is set, the classification rate per each class is visualized, and the recall and precision values are not computed.

Parameters
confusionMatConfusion matrix: Mat of type: CV_32FC1
flagMapping flag (Ref. mark_flags)
Returns
Figure with visualized confusion matrix

Definition at line 86 of file Marker.cpp.

Here is the call graph for this function:

◆ drawMatrix()

Mat DirectGraphicalModels::vis::CMarker::drawMatrix ( const Mat &  potential,
byte  flag 
) const
private

Definition at line 210 of file Marker.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ drawPotentials()

Mat DirectGraphicalModels::vis::CMarker::drawPotentials ( const Mat &  potential,
byte  flag = 0 
) const

Visualizes the potentials.

Draws <node / edge / triplet> [potential / prior] <vector / matrix / voxel>

This function is also suit for the confusion matrix visualization, but function drawConfusionMatrix() is more preferable for such task

Parameters
potentialNode, edge or triplet potential or prior. One, two or tree dimensional Mat of type: CV_32FC1
flagMapping flag (Ref. mark_flags)
Returns
Figure with visualized potential or prior
Note
This function curently does not support triplet [potential / prior] voxels

Definition at line 76 of file Marker.cpp.

Here is the call graph for this function:

◆ drawRectangle() [1/2]

void DirectGraphicalModels::vis::CMarker::drawRectangle ( Mat &  img,
Point  pt1,
Point  pt2,
const Scalar &  color,
float  val,
double  fontScale = 1.0,
byte  textProp = TP_CENTER 
) const
private

Definition at line 273 of file Marker.cpp.

Here is the caller graph for this function:

◆ drawRectangle() [2/2]

void DirectGraphicalModels::vis::CMarker::drawRectangle ( Mat &  img,
Point  pt1,
Point  pt2,
const Scalar &  color,
const std::string &  str = std::string(),
double  fontScale = 1.0,
byte  textProp = TP_CENTER 
) const
private

Definition at line 299 of file Marker.cpp.

◆ drawSquare()

template<typename T >
void DirectGraphicalModels::vis::CMarker::drawSquare ( Mat &  img,
byte  x,
byte  y,
const Scalar &  color,
val,
double  fontScale = 1.0,
byte  textProp = 0 
) const
private

Definition at line 266 of file Marker.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ drawVector()

Mat DirectGraphicalModels::vis::CMarker::drawVector ( const Mat &  potential,
byte  flag 
) const
private

Definition at line 172 of file Marker.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ drawVoxel()

Mat DirectGraphicalModels::vis::CMarker::drawVoxel ( const Mat &  potential,
byte  flag 
) const
private

Definition at line 259 of file Marker.cpp.

Here is the caller graph for this function:

◆ markClasses()

void DirectGraphicalModels::vis::CMarker::markClasses ( Mat &  base,
const Mat &  classes,
byte  flag = 0 
) const

Visualizes the classes.

Draws the classes image on base image.

Parameters
[in,out]baseBase image on which the classes will be mapped. Image of type: CV_8UC3. May be empty.
[in]classesClass map image. Image of type: CV_8UC1.
[in]flagMapping flag (Ref. mark_flags).

Definition at line 43 of file Marker.cpp.

◆ operator=()

const CMarker& DirectGraphicalModels::vis::CMarker::operator= ( const CMarker )
privatedelete

Member Data Documentation

◆ bkgIntencity

const byte DirectGraphicalModels::vis::CMarker::bkgIntencity = 222
staticprivate

Definition at line 151 of file Marker.h.

◆ ds

const int DirectGraphicalModels::vis::CMarker::ds = 70
staticprivate

Definition at line 153 of file Marker.h.

◆ frgIntensity

const byte DirectGraphicalModels::vis::CMarker::frgIntensity = 255
staticprivate

Definition at line 152 of file Marker.h.

◆ m_vPalette

vec_nColor_t DirectGraphicalModels::vis::CMarker::m_vPalette
protected

Pointer to the container with the palette.

Definition at line 136 of file Marker.h.


The documentation for this class was generated from the following files: