Spoofing Detection Engine  1.0
Classes | Functions | Variables
visualization Namespace Reference

The visualization namespace contains classes and functions related to visual asset management. More...

Classes

class  Triangle
 Represents a triangle with vertex indices. More...
 
class  FaceDrawer
 Draws triangulation on faces based on facial points. More...
 
class  VisualAsset
 The VisualAsset class manages visual assets like images for rendering and manipulation. More...
 

Functions

cv::Scalar baseGreenColor (91, 192, 75)
 
cv::Scalar baseBrightGreenColor (91, 222, 75)
 
double drawNormalizedEye (cv::Mat &image, cv::Rect position, std::vector< cv::Point > eyeLidFrom, std::vector< cv::Point > iris)
 Draw the normalized eye on the given image and return the iris-pupil size ratio. More...
 
void drawLandmarks (cv::Mat &image, const std::vector< cv::Point > &points, cv::Scalar color, const std::vector< std::pair< int, int >> &connections, double alpha=0.0)
 Draw landmarks on the given image. More...
 
void drawHalo (cv::Mat &image, cv::Rect faceRect, std::vector< visualization::VisualAsset > &assets, double rotationKernel)
 Draw a halo effect on the given face rectangle in the image. More...
 
void drawInfo (cv::Mat &image, cv::Rect faceRect, visualization::VisualAsset &infoBox, const std::string &info)
 Draw information box on the given face rectangle in the image. More...
 
void printText (cv::Mat &frame, cv::Point pos, std::string text, double fontScale)
 Print text on the given frame at the specified position. More...
 
double findCircleX (const cv::Rect &rect, double y)
 Calculate the X coordinate on a circle for a given Y coordinate. More...
 
void alphaBlendPixel (cv::Vec3b &dst, const cv::Vec3b &src, float alpha)
 
void drawEllipse (cv::Mat &image, const cv::Point &center, int baseRadius, double scaleFactor, int startAngle, int endAngle, double thickness, cv::Scalar baseColor=baseGreenColor, cv::Scalar brightColor=baseBrightGreenColor)
 Draw a custom ellipse onto an image. More...
 
void drawEllipseAlpha (cv::Mat &image, cv::Point center, int baseRadius, double scale, int startAngle, int endAngle, int thickness, const cv::Scalar &baseColor, const cv::Scalar &brightColor, float alpha)
 
void drawHaloAnimation (cv::Mat image, cv::Rect faceRect, long long seed, cv::Scalar baseColor=baseGreenColor, cv::Scalar brightColor=baseBrightGreenColor)
 Draw an animated halo around the given face rectangle. More...
 
void showDetectionProperties (cv::Mat &image, const std::map< std::string, std::string > &values, cv::Rect faceRect, cv::Point startPoint, cv::Scalar backgroundColor=baseGreenColor)
 Display detection properties next to a face region. More...
 

Variables

cv::Scalar baseGreenColor
 
cv::Scalar baseBrightGreenColor
 

Detailed Description

The visualization namespace contains classes and functions related to visual asset management.

Function Documentation

◆ drawEllipse()

void visualization::drawEllipse ( cv::Mat &  image,
const cv::Point &  center,
int  baseRadius,
double  scaleFactor,
int  startAngle,
int  endAngle,
double  thickness,
cv::Scalar  baseColor = baseGreenColor,
cv::Scalar  brightColor = baseBrightGreenColor 
)

Draw a custom ellipse onto an image.

Parameters
imageDestination image.
centerCenter point of the ellipse.
baseRadiusBase radius used for scaling.
scaleFactorAdditional scaling factor for the radius.
startAngleStarting angle of the ellipse arc.
endAngleLength of the arc in degrees.
thicknessThickness of the drawn lines.

◆ drawHalo()

void visualization::drawHalo ( cv::Mat &  image,
cv::Rect  faceRect,
std::vector< visualization::VisualAsset > &  assets,
double  rotationKernel 
)

Draw a halo effect on the given face rectangle in the image.

Parameters
imageThe image on which to draw the halo.
faceRectThe rectangle defining the face's position.
assetsA vector of visual assets to be used for the halo effect.
rotationKernelThe kernel for rotation transformation.

◆ drawHaloAnimation()

void visualization::drawHaloAnimation ( cv::Mat  image,
cv::Rect  faceRect,
long long  seed,
cv::Scalar  baseColor = baseGreenColor,
cv::Scalar  brightColor = baseBrightGreenColor 
)

Draw an animated halo around the given face rectangle.

Parameters
imageImage where the halo should be drawn.
faceRectRectangle of the detected face.
seedSeed value controlling animation phase.
Here is the caller graph for this function:

◆ drawInfo()

void visualization::drawInfo ( cv::Mat &  image,
cv::Rect  faceRect,
visualization::VisualAsset infoBox,
const std::string &  info 
)

Draw information box on the given face rectangle in the image.

Parameters
imageThe image on which to draw the info box.
faceRectThe rectangle defining the face's position.
infoBoxThe visual asset representing the info box.
infoThe string containing the information to be displayed.
Here is the call graph for this function:

◆ drawLandmarks()

void visualization::drawLandmarks ( cv::Mat &  image,
const std::vector< cv::Point > &  points,
cv::Scalar  color,
const std::vector< std::pair< int, int >> &  connections,
double  alpha = 0.0 
)

Draw landmarks on the given image.

Parameters
imageThe image on which to draw the landmarks.
pointsA vector of points representing the landmarks.
colorThe color of the landmarks.
connectionsA vector of pairs of integers representing the connections between landmarks.
alphaTransparency of the landmarks.

◆ drawNormalizedEye()

double visualization::drawNormalizedEye ( cv::Mat &  image,
cv::Rect  position,
std::vector< cv::Point >  eyeLidFrom,
std::vector< cv::Point >  iris 
)

Draw the normalized eye on the given image and return the iris-pupil size ratio.

Parameters
imageThe image on which to draw.
positionThe rectangle defining the position to draw the eye.
eyeLidFromA vector of points representing the eyelid.
irisA vector of points representing the iris.
Returns
double The ratio of the iris to pupil size.

◆ findCircleX()

double visualization::findCircleX ( const cv::Rect &  rect,
double  y 
)

Calculate the X coordinate on a circle for a given Y coordinate.

Parameters
rectBounding rectangle describing the circle.
yY coordinate for which the X coordinate should be returned.
Returns
The X coordinate on the circle or 0 if not valid.
Here is the caller graph for this function:

◆ printText()

void visualization::printText ( cv::Mat &  frame,
cv::Point  pos,
std::string  text,
double  fontScale 
)

Print text on the given frame at the specified position.

Parameters
frameThe frame on which to print the text.
posThe position at which to print the text.
textThe string of text to be printed.
fontScaleThe scale of the font to be used.

◆ showDetectionProperties()

void visualization::showDetectionProperties ( cv::Mat &  image,
const std::map< std::string, std::string > &  values,
cv::Rect  faceRect,
cv::Point  startPoint,
cv::Scalar  backgroundColor = baseGreenColor 
)

Display detection properties next to a face region.

Parameters
imageImage onto which the text boxes are drawn.
valuesMap of key-value property pairs to display.
faceRectRectangle of the detected face.
startPointStarting position for the first text box.
Here is the call graph for this function:
Here is the caller graph for this function: