Dlib FaceLandmark Detector 1.4.1
Enox Software
Loading...
Searching...
No Matches
DlibFaceLandmarkDetectorExample.OpenCVForUnityUtils Class Reference

Utility class for the integration of DlibFaceLandmarkDetector and OpenCVForUnity. More...

Static Public Member Functions

static Point[] ConvertArrayToPointArray (double[] src, Point[] dst=null)
 Convert double array to Point array.
 
static List< Point > ConvertArrayToPointList (double[] src, List< Point > dst=null)
 Convert double array to Point list.
 
static double double y[] ConvertArrayToValueTupleArray (double[] src,(double x, double y)[] dst=null)
 
static Vec2d[] ConvertArrayToVec2dArray (double[] src, Vec2d[] dst=null)
 Convert double array to Vec2d array.
 
static Vector2[] ConvertArrayToVector2Array (double[] src, Vector2[] dst=null)
 Convert double array to Vector2 array.
 
static List< Vector2 > ConvertArrayToVector2List (double[] src, List< Vector2 > dst=null)
 Convert double array to Vector2 list.
 
static double[] ConvertPointListToArray (IList< Point > src, double[] dst=null)
 Convert Point list to double array.
 
static Point[] ConvertPointListToPointArray (IList< Point > src, Point[] dst=null)
 Convert Point list to Point array.
 
static double double y[] ConvertPointListToValueTupleArray (IList< Point > src,(double x, double y)[] dst=null)
 
static Vec2d[] ConvertPointListToVec2dArray (IList< Point > src, Vec2d[] dst=null)
 Convert Point list to Vec2d array.
 
static Vector2[] ConvertPointListToVector2Array (IList< Point > src, Vector2[] dst=null)
 Convert Point list to Vector2 array.
 
static List< Vector2 > ConvertPointListToVector2List (IList< Point > src, List< Vector2 > dst=null)
 Convert Point list to Vector2 list.
 
static double[] ConvertValueTupleArrayToArray (in(double x, double y)[] src, double[] dst=null)
 Convert ValueTuple array to double array.
 
static Point[] ConvertValueTupleArrayToPointArray (in(double x, double y)[] src, Point[] dst=null)
 Convert ValueTuple array to Point array.
 
static List< Point > ConvertValueTupleArrayToPointList (in(double x, double y)[] src, List< Point > dst=null)
 Convert ValueTuple array to Point list.
 
static Vec2d[] ConvertValueTupleArrayToVec2dArray (in(double x, double y)[] src, Vec2d[] dst=null)
 Convert ValueTuple array to Vec2d array.
 
static double[] ConvertVec2dArrayToArray (in Vec2d[] src, double[] dst=null)
 Convert Vec2d array to double array.
 
static Point[] ConvertVec2dArrayToPointArray (in Vec2d[] src, Point[] dst=null)
 Convert Vec2d array to Point array.
 
static List< Point > ConvertVec2dArrayToPointList (in Vec2d[] src, List< Point > dst=null)
 Convert Vec2d array to Point list.
 
static double double y[] ConvertVec2dArrayToValueTupleArray (in Vec2d[] src,(double x, double y)[] dst=null)
 
static double[] ConvertVector2ListToArray (IList< Vector2 > src, double[] dst=null)
 Convert Vector2 list to double array.
 
static Point[] ConvertVector2ListToPointArray (IList< Vector2 > src, Point[] dst=null)
 Convert Vector2 list to Point array.
 
static List< Point > ConvertVector2ListToPointList (IList< Vector2 > src, List< Point > dst=null)
 Convert Vector2 list to Point list.
 
static double double y[] ConvertVector2ListToValueTupleArray (IList< Vector2 > src,(double x, double y)[] dst=null)
 
static Vec2d[] ConvertVector2ListToVec2dArray (IList< Vector2 > src, Vec2d[] dst=null)
 Convert Vector2 list to Vec2d array.
 
static Vector2[] ConvertVector2ListToVector2Array (IList< Vector2 > src, Vector2[] dst=null)
 Convert Vector2 list to Vector2 array.
 
static void DrawFaceLandmark (Mat imgMat, double[] points, in Vec4d color, int thickness, bool drawIndexNumbers=false)
 Draws a face landmark on the specified image. This method supports drawing landmarks for 68, 17, 6, or 5 landmark points. The landmarks are drawn by connecting the points with lines, and optionally, index numbers can be drawn on each point.
 
static void DrawFaceLandmark (Mat imgMat, double[] points, in(double v0, double v1, double v2, double v3) color, int thickness, bool drawIndexNumbers=false)
 Draws a face landmark on the specified image. This method supports drawing landmarks for 68, 17, 6, or 5 landmark points. The landmarks are drawn by connecting the points with lines, and optionally, index numbers can be drawn on each point.
 
static void DrawFaceLandmark (Mat imgMat, double[] points, Scalar color, int thickness, bool drawIndexNumbers=false)
 Draws a face landmark on the specified image. This method supports drawing landmarks for 68, 17, 6, or 5 landmark points. The landmarks are drawn by connecting the points with lines, and optionally, index numbers can be drawn on each point.
 
static void DrawFaceLandmark (Mat imgMat, IList< Point > points, Scalar color, int thickness, bool drawIndexNumbers=false)
 Draws a face landmark on the specified image. This method supports drawing landmarks for 68, 17, 6, or 5 landmark points. The landmarks are drawn by connecting the points with lines, and optionally, index numbers can be drawn on each point.
 
static void DrawFaceLandmark (Mat imgMat, IList< Vector2 > points, Scalar color, int thickness, bool drawIndexNumbers=false)
 Draws a face landmark on the specified image. This method supports drawing landmarks for 68, 17, 6, or 5 landmark points. The landmarks are drawn by connecting the points with lines, and optionally, index numbers can be drawn on each point.
 
static void DrawFaceLandmark (Mat imgMat, in Vec2d[] points, in Vec4d color, int thickness, bool drawIndexNumbers=false)
 Draws a face landmark on the specified image. This method supports drawing landmarks for 68, 17, 6, or 5 landmark points. The landmarks are drawn by connecting the points with lines, and optionally, index numbers can be drawn on each point.
 
static void DrawFaceLandmark (Mat imgMat, in(double x, double y)[] points, in(double v0, double v1, double v2, double v3) color, int thickness, bool drawIndexNumbers=false)
 Draws a face landmark on the specified image. This method supports drawing landmarks for 68, 17, 6, or 5 landmark points. The landmarks are drawn by connecting the points with lines, and optionally, index numbers can be drawn on each point.
 
static void DrawFaceRect (Mat imgMat, DlibFaceLandmarkDetector.FaceLandmarkDetector.RectDetection rect, in Vec4d color, int thickness)
 Draws a rectangle and detection information on the specified image based on the given DlibFaceLandmarkDetector.FaceLandmarkDetector.RectDetection data.
 
static void DrawFaceRect (Mat imgMat, DlibFaceLandmarkDetector.FaceLandmarkDetector.RectDetection rect, in(double v0, double v1, double v2, double v3) color, int thickness)
 Draws a rectangle and detection information on the specified image based on the given DlibFaceLandmarkDetector.FaceLandmarkDetector.RectDetection data.
 
static void DrawFaceRect (Mat imgMat, DlibFaceLandmarkDetector.FaceLandmarkDetector.RectDetection rect, Scalar color, int thickness)
 Draws a rectangle and detection information on the specified image based on the given RectDetection data.
 
static void DrawFaceRect (Mat imgMat, double[] rect, in Vec4d color, int thickness)
 Draws a rectangle and detection information on the specified image based on the provided rectangle data.
 
static void DrawFaceRect (Mat imgMat, double[] rect, in(double v0, double v1, double v2, double v3) color, int thickness)
 Draws a rectangle and detection information on the specified image based on the provided rectangle data.
 
static void DrawFaceRect (Mat imgMat, double[] rect, Scalar color, int thickness)
 Draws a rectangle and detection information on the specified image based on the provided rectangle data.
 
static void DrawFaceRect (Mat imgMat, in Vec4d rect, in Vec4d color, int thickness)
 Draws a rectangle on the specified image to indicate a detected face region.
 
static void DrawFaceRect (Mat imgMat, in Vec4i rect, in Vec4d color, int thickness)
 Draws a rectangle on the specified image to indicate a detected face region.
 
static void DrawFaceRect (Mat imgMat, in(double x, double y, double width, double height) rect, in(double v0, double v1, double v2, double v3) color, int thickness)
 Draws a rectangle on the specified image to indicate a detected face region.
 
static void DrawFaceRect (Mat imgMat, in(int x, int y, int width, int height) rect, in(double v0, double v1, double v2, double v3) color, int thickness)
 Draws a rectangle on the specified image to indicate a detected face region.
 
static void DrawFaceRect (Mat imgMat, OpenCVForUnity.CoreModule.Rect rect, Scalar color, int thickness)
 Draws a rectangle on the specified image to indicate a detected face region.
 
static void DrawFaceRect (Mat imgMat, UnityEngine.Rect rect, in Vec4d color, int thickness)
 Draws a rectangle on the specified image to indicate a detected face region.
 
static void DrawFaceRect (Mat imgMat, UnityEngine.Rect rect, in(double v0, double v1, double v2, double v3) color, int thickness)
 Draws a rectangle on the specified image to indicate a detected face region.
 
static void DrawFaceRect (Mat imgMat, UnityEngine.Rect rect, Scalar color, int thickness)
 Draws a rectangle on the specified image to indicate a detected face region.
 
static void SetImage (FaceLandmarkDetector faceLandmarkDetector, Mat imgMat)
 Sets the image for the specified FaceLandmarkDetector using a given Mat object.
 

Static Public Attributes

static double x
 Convert Vector2 list to ValueTuple array.
 

Detailed Description

Utility class for the integration of DlibFaceLandmarkDetector and OpenCVForUnity.

Member Function Documentation

◆ ConvertArrayToPointArray()

static Point[] DlibFaceLandmarkDetectorExample.OpenCVForUnityUtils.ConvertArrayToPointArray ( double[] src,
Point[] dst = null )
static

Convert double array to Point array.

Parameters
srcArray of double.
dstArray of Point.
Returns
Array of Point.

◆ ConvertArrayToPointList()

static List< Point > DlibFaceLandmarkDetectorExample.OpenCVForUnityUtils.ConvertArrayToPointList ( double[] src,
List< Point > dst = null )
static

Convert double array to Point list.

Parameters
srcArray of double.
dstList of Point.
Returns
List of Point.

◆ ConvertArrayToValueTupleArray()

static double double y[] DlibFaceLandmarkDetectorExample.OpenCVForUnityUtils.ConvertArrayToValueTupleArray ( double[] src,
(double x, double y)[] dst = null )
static

◆ ConvertArrayToVec2dArray()

static Vec2d[] DlibFaceLandmarkDetectorExample.OpenCVForUnityUtils.ConvertArrayToVec2dArray ( double[] src,
Vec2d[] dst = null )
static

Convert double array to Vec2d array.

Parameters
srcArray of double.
dstArray of Vec2d.
Returns
Array of Vec2d.

◆ ConvertArrayToVector2Array()

static Vector2[] DlibFaceLandmarkDetectorExample.OpenCVForUnityUtils.ConvertArrayToVector2Array ( double[] src,
Vector2[] dst = null )
static

Convert double array to Vector2 array.

Parameters
srcArray of double.
dstArray of Vector2.
Returns
Array of Vector2.

◆ ConvertArrayToVector2List()

static List< Vector2 > DlibFaceLandmarkDetectorExample.OpenCVForUnityUtils.ConvertArrayToVector2List ( double[] src,
List< Vector2 > dst = null )
static

Convert double array to Vector2 list.

Parameters
srcArray of double.
dstList of Vector2.
Returns
List of Vector2.

◆ ConvertPointListToArray()

static double[] DlibFaceLandmarkDetectorExample.OpenCVForUnityUtils.ConvertPointListToArray ( IList< Point > src,
double[] dst = null )
static

Convert Point list to double array.

Parameters
srcList of Point.
dstArray of double.
Returns
Array of double.

◆ ConvertPointListToPointArray()

static Point[] DlibFaceLandmarkDetectorExample.OpenCVForUnityUtils.ConvertPointListToPointArray ( IList< Point > src,
Point[] dst = null )
static

Convert Point list to Point array.

Parameters
srcList of Point.
dstArray of Point.
Returns
Array of Point.

◆ ConvertPointListToValueTupleArray()

static double double y[] DlibFaceLandmarkDetectorExample.OpenCVForUnityUtils.ConvertPointListToValueTupleArray ( IList< Point > src,
(double x, double y)[] dst = null )
static

◆ ConvertPointListToVec2dArray()

static Vec2d[] DlibFaceLandmarkDetectorExample.OpenCVForUnityUtils.ConvertPointListToVec2dArray ( IList< Point > src,
Vec2d[] dst = null )
static

Convert Point list to Vec2d array.

Parameters
srcList of Point.
dstArray of Vec2d.
Returns
Array of Vec2d.

◆ ConvertPointListToVector2Array()

static Vector2[] DlibFaceLandmarkDetectorExample.OpenCVForUnityUtils.ConvertPointListToVector2Array ( IList< Point > src,
Vector2[] dst = null )
static

Convert Point list to Vector2 array.

Parameters
srcList of Point.
dstArray of Vector2.
Returns
Array of Vector2.

◆ ConvertPointListToVector2List()

static List< Vector2 > DlibFaceLandmarkDetectorExample.OpenCVForUnityUtils.ConvertPointListToVector2List ( IList< Point > src,
List< Vector2 > dst = null )
static

Convert Point list to Vector2 list.

Parameters
srcList of Point.
dstList of Vector2.
Returns
List of Vector2.

◆ ConvertValueTupleArrayToArray()

static double[] DlibFaceLandmarkDetectorExample.OpenCVForUnityUtils.ConvertValueTupleArrayToArray ( in(double x, double y)[] src,
double[] dst = null )
static

Convert ValueTuple array to double array.

Parameters
srcArray of ValueTuple.
dstArray of double.
Returns
Array of double.

◆ ConvertValueTupleArrayToPointArray()

static Point[] DlibFaceLandmarkDetectorExample.OpenCVForUnityUtils.ConvertValueTupleArrayToPointArray ( in(double x, double y)[] src,
Point[] dst = null )
static

Convert ValueTuple array to Point array.

Parameters
srcArray of ValueTuple.
dstArray of Point.
Returns
Array of Point.

◆ ConvertValueTupleArrayToPointList()

static List< Point > DlibFaceLandmarkDetectorExample.OpenCVForUnityUtils.ConvertValueTupleArrayToPointList ( in(double x, double y)[] src,
List< Point > dst = null )
static

Convert ValueTuple array to Point list.

Parameters
srcArray of ValueTuple.
dstList of Point.
Returns
List of Point.

◆ ConvertValueTupleArrayToVec2dArray()

static Vec2d[] DlibFaceLandmarkDetectorExample.OpenCVForUnityUtils.ConvertValueTupleArrayToVec2dArray ( in(double x, double y)[] src,
Vec2d[] dst = null )
static

Convert ValueTuple array to Vec2d array.

Parameters
srcArray of ValueTuple.
dstArray of Vec2d.
Returns
Array of Vec2d.

◆ ConvertVec2dArrayToArray()

static double[] DlibFaceLandmarkDetectorExample.OpenCVForUnityUtils.ConvertVec2dArrayToArray ( in Vec2d[] src,
double[] dst = null )
static

Convert Vec2d array to double array.

Parameters
srcArray of Vec2d.
dstArray of double.
Returns
Array of double.

◆ ConvertVec2dArrayToPointArray()

static Point[] DlibFaceLandmarkDetectorExample.OpenCVForUnityUtils.ConvertVec2dArrayToPointArray ( in Vec2d[] src,
Point[] dst = null )
static

Convert Vec2d array to Point array.

Parameters
srcArray of Vec2d.
dstArray of Point.
Returns
Array of Point.

◆ ConvertVec2dArrayToPointList()

static List< Point > DlibFaceLandmarkDetectorExample.OpenCVForUnityUtils.ConvertVec2dArrayToPointList ( in Vec2d[] src,
List< Point > dst = null )
static

Convert Vec2d array to Point list.

Parameters
srcArray of Vec2d.
dstList of Point.
Returns
List of Point.

◆ ConvertVec2dArrayToValueTupleArray()

static double double y[] DlibFaceLandmarkDetectorExample.OpenCVForUnityUtils.ConvertVec2dArrayToValueTupleArray ( in Vec2d[] src,
(double x, double y)[] dst = null )
static

◆ ConvertVector2ListToArray()

static double[] DlibFaceLandmarkDetectorExample.OpenCVForUnityUtils.ConvertVector2ListToArray ( IList< Vector2 > src,
double[] dst = null )
static

Convert Vector2 list to double array.

Parameters
srcList of Vector2.
dstArray of double.
Returns
Array of double.

◆ ConvertVector2ListToPointArray()

static Point[] DlibFaceLandmarkDetectorExample.OpenCVForUnityUtils.ConvertVector2ListToPointArray ( IList< Vector2 > src,
Point[] dst = null )
static

Convert Vector2 list to Point array.

Parameters
srcList of Vector2.
dstArray of Point.
Returns
Array of Point.

◆ ConvertVector2ListToPointList()

static List< Point > DlibFaceLandmarkDetectorExample.OpenCVForUnityUtils.ConvertVector2ListToPointList ( IList< Vector2 > src,
List< Point > dst = null )
static

Convert Vector2 list to Point list.

Parameters
srcList of Vector2.
dstList of Point.
Returns
List of Point.

◆ ConvertVector2ListToValueTupleArray()

static double double y[] DlibFaceLandmarkDetectorExample.OpenCVForUnityUtils.ConvertVector2ListToValueTupleArray ( IList< Vector2 > src,
(double x, double y)[] dst = null )
static

◆ ConvertVector2ListToVec2dArray()

static Vec2d[] DlibFaceLandmarkDetectorExample.OpenCVForUnityUtils.ConvertVector2ListToVec2dArray ( IList< Vector2 > src,
Vec2d[] dst = null )
static

Convert Vector2 list to Vec2d array.

Parameters
srcList of Vector2.
dstArray of Vec2d.
Returns
Array of Vec2d.

◆ ConvertVector2ListToVector2Array()

static Vector2[] DlibFaceLandmarkDetectorExample.OpenCVForUnityUtils.ConvertVector2ListToVector2Array ( IList< Vector2 > src,
Vector2[] dst = null )
static

Convert Vector2 list to Vector2 array.

Parameters
srcList of Vector2.
dstArray of Vector2.
Returns
Array of Vector2.

◆ DrawFaceLandmark() [1/7]

static void DlibFaceLandmarkDetectorExample.OpenCVForUnityUtils.DrawFaceLandmark ( Mat imgMat,
double[] points,
in Vec4d color,
int thickness,
bool drawIndexNumbers = false )
static

Draws a face landmark on the specified image. This method supports drawing landmarks for 68, 17, 6, or 5 landmark points. The landmarks are drawn by connecting the points with lines, and optionally, index numbers can be drawn on each point.

Parameters
imgMatThe Mat image on which to draw the face landmarks.
pointsA double array representing the landmark positions, where each pair of consecutive values represents the X and Y coordinates of a point. The number of points must match one of the following: 5 points for a basic face shape (e.g., eyes, nose, mouth), 6 points for a face with more detailed landmarks, 17 points for a detailed face shape, or 68 points for a full set of face landmarks.
colorThe Vec4d color used to draw the landmarks and lines.
thicknessThe thickness of the lines used to connect the landmarks.
drawIndexNumbersIf set to true, index numbers will be drawn next to each landmark point. If set to false, no index numbers will be drawn. Default is false.
Exceptions
ArgumentNullExceptionThrown if points is null.

◆ DrawFaceLandmark() [2/7]

static void DlibFaceLandmarkDetectorExample.OpenCVForUnityUtils.DrawFaceLandmark ( Mat imgMat,
double[] points,
in(double v0, double v1, double v2, double v3) color,
int thickness,
bool drawIndexNumbers = false )
static

Draws a face landmark on the specified image. This method supports drawing landmarks for 68, 17, 6, or 5 landmark points. The landmarks are drawn by connecting the points with lines, and optionally, index numbers can be drawn on each point.

Parameters
imgMatThe Mat image on which to draw the face landmarks.
pointsA double array representing the landmark positions, where each pair of consecutive values represents the X and Y coordinates of a point. The number of points must match one of the following: 5 points for a basic face shape (e.g., eyes, nose, mouth), 6 points for a face with more detailed landmarks, 17 points for a detailed face shape, or 68 points for a full set of face landmarks.
colorThe ValueTuple<Double, Double, Double, Double> color used to draw the landmarks and lines.
thicknessThe thickness of the lines used to connect the landmarks.
drawIndexNumbersIf set to true, index numbers will be drawn next to each landmark point. If set to false, no index numbers will be drawn. Default is false.
Exceptions
ArgumentNullExceptionThrown if points is null.

◆ DrawFaceLandmark() [3/7]

static void DlibFaceLandmarkDetectorExample.OpenCVForUnityUtils.DrawFaceLandmark ( Mat imgMat,
double[] points,
Scalar color,
int thickness,
bool drawIndexNumbers = false )
static

Draws a face landmark on the specified image. This method supports drawing landmarks for 68, 17, 6, or 5 landmark points. The landmarks are drawn by connecting the points with lines, and optionally, index numbers can be drawn on each point.

Parameters
imgMatThe Mat image on which to draw the face landmarks.
pointsA list of Point points representing the landmark positions. The number of points must match one of the following: 5 points for a basic face shape (e.g., eyes, nose, mouth), 6 points for a face with more detailed landmarks, 17 points for a detailed face shape, or 68 points for a full set of face landmarks.
colorThe Scalar color used to draw the landmarks and lines.
thicknessThe thickness of the lines used to connect the landmarks.
drawIndexNumbersIf set to true, index numbers will be drawn next to each landmark point. If set to false, no index numbers will be drawn. Default is false.
Exceptions
ArgumentNullExceptionThrown if points is null.

◆ DrawFaceLandmark() [4/7]

static void DlibFaceLandmarkDetectorExample.OpenCVForUnityUtils.DrawFaceLandmark ( Mat imgMat,
IList< Point > points,
Scalar color,
int thickness,
bool drawIndexNumbers = false )
static

Draws a face landmark on the specified image. This method supports drawing landmarks for 68, 17, 6, or 5 landmark points. The landmarks are drawn by connecting the points with lines, and optionally, index numbers can be drawn on each point.

Parameters
imgMatThe Mat image on which to draw the face landmarks.
pointsA list of Point points representing the landmark positions. The number of points must match one of the following: 5 points for a basic face shape (e.g., eyes, nose, mouth), 6 points for a face with more detailed landmarks, 17 points for a detailed face shape, or 68 points for a full set of face landmarks.
colorThe Scalar color used to draw the landmarks and lines.
thicknessThe thickness of the lines used to connect the landmarks.
drawIndexNumbersIf set to true, index numbers will be drawn next to each landmark point. If set to false, no index numbers will be drawn. Default is false.
Exceptions
ArgumentNullExceptionThrown if points is null.

◆ DrawFaceLandmark() [5/7]

static void DlibFaceLandmarkDetectorExample.OpenCVForUnityUtils.DrawFaceLandmark ( Mat imgMat,
IList< Vector2 > points,
Scalar color,
int thickness,
bool drawIndexNumbers = false )
static

Draws a face landmark on the specified image. This method supports drawing landmarks for 68, 17, 6, or 5 landmark points. The landmarks are drawn by connecting the points with lines, and optionally, index numbers can be drawn on each point.

Parameters
imgMatThe Mat image on which to draw the face landmarks.
pointsA list of Vector2 points representing the landmark positions. The number of points must match one of the following: 5 points for a basic face shape (e.g., eyes, nose, mouth), 6 points for a face with more detailed landmarks, 17 points for a detailed face shape, or 68 points for a full set of face landmarks.
colorThe Scalar color used to draw the landmarks and lines.
thicknessThe thickness of the lines used to connect the landmarks.
drawIndexNumbersIf set to true, index numbers will be drawn next to each landmark point. If set to false, no index numbers will be drawn. Default is false.
Exceptions
ArgumentNullExceptionThrown if points is null.

◆ DrawFaceLandmark() [6/7]

static void DlibFaceLandmarkDetectorExample.OpenCVForUnityUtils.DrawFaceLandmark ( Mat imgMat,
in Vec2d[] points,
in Vec4d color,
int thickness,
bool drawIndexNumbers = false )
static

Draws a face landmark on the specified image. This method supports drawing landmarks for 68, 17, 6, or 5 landmark points. The landmarks are drawn by connecting the points with lines, and optionally, index numbers can be drawn on each point.

Parameters
imgMatThe Mat image on which to draw the face landmarks.
pointsA list of Vec2d points representing the landmark positions. The number of points must match one of the following: 5 points for a basic face shape (e.g., eyes, nose, mouth), 6 points for a face with more detailed landmarks, 17 points for a detailed face shape, or 68 points for a full set of face landmarks.
colorThe Vec4d color used to draw the landmarks and lines.
thicknessThe thickness of the lines used to connect the landmarks.
drawIndexNumbersIf set to true, index numbers will be drawn next to each landmark point. If set to false, no index numbers will be drawn. Default is false.
Exceptions
ArgumentNullExceptionThrown if points is null.

◆ DrawFaceLandmark() [7/7]

static void DlibFaceLandmarkDetectorExample.OpenCVForUnityUtils.DrawFaceLandmark ( Mat imgMat,
in(double x, double y)[] points,
in(double v0, double v1, double v2, double v3) color,
int thickness,
bool drawIndexNumbers = false )
static

Draws a face landmark on the specified image. This method supports drawing landmarks for 68, 17, 6, or 5 landmark points. The landmarks are drawn by connecting the points with lines, and optionally, index numbers can be drawn on each point.

Parameters
imgMatThe Mat image on which to draw the face landmarks.
pointsA list of ValueTuple<Double, Double> points representing the landmark positions. The number of points must match one of the following: 5 points for a basic face shape (e.g., eyes, nose, mouth), 6 points for a face with more detailed landmarks, 17 points for a detailed face shape, or 68 points for a full set of face landmarks.
colorThe ValueTuple<Double, Double, Double, Double> color used to draw the landmarks and lines.
thicknessThe thickness of the lines used to connect the landmarks.
drawIndexNumbersIf set to true, index numbers will be drawn next to each landmark point. If set to false, no index numbers will be drawn. Default is false.
Exceptions
ArgumentNullExceptionThrown if points is null.

◆ DrawFaceRect() [1/14]

static void DlibFaceLandmarkDetectorExample.OpenCVForUnityUtils.DrawFaceRect ( Mat imgMat,
DlibFaceLandmarkDetector.FaceLandmarkDetector.RectDetection rect,
in Vec4d color,
int thickness )
static

Draws a rectangle and detection information on the specified image based on the given DlibFaceLandmarkDetector.FaceLandmarkDetector.RectDetection data.

Parameters
imgMatThe Mat image on which to draw the rectangle and text.
rectThe DlibFaceLandmarkDetector.FaceLandmarkDetector.RectDetection containing the rectangle and detection details.
colorThe Vec4d color of the rectangle border.
thicknessThe thickness of the rectangle border.
Exceptions
ArgumentNullExceptionThrown if rect is null.

◆ DrawFaceRect() [2/14]

static void DlibFaceLandmarkDetectorExample.OpenCVForUnityUtils.DrawFaceRect ( Mat imgMat,
DlibFaceLandmarkDetector.FaceLandmarkDetector.RectDetection rect,
in(double v0, double v1, double v2, double v3) color,
int thickness )
static

Draws a rectangle and detection information on the specified image based on the given DlibFaceLandmarkDetector.FaceLandmarkDetector.RectDetection data.

Parameters
imgMatThe Mat image on which to draw the rectangle and text.
rectThe DlibFaceLandmarkDetector.FaceLandmarkDetector.RectDetection containing the rectangle and detection details.
colorThe ValueTuple<Double, Double, Double, Double> color of the rectangle border.
thicknessThe thickness of the rectangle border.
Exceptions
ArgumentNullExceptionThrown if rect is null.

◆ DrawFaceRect() [3/14]

static void DlibFaceLandmarkDetectorExample.OpenCVForUnityUtils.DrawFaceRect ( Mat imgMat,
DlibFaceLandmarkDetector.FaceLandmarkDetector.RectDetection rect,
Scalar color,
int thickness )
static

Draws a rectangle and detection information on the specified image based on the given RectDetection data.

Parameters
imgMatThe Mat image on which to draw the rectangle and text.
rectThe DlibFaceLandmarkDetector.FaceLandmarkDetector.RectDetection containing the rectangle and detection details.
colorThe Scalar color of the rectangle border.
thicknessThe thickness of the rectangle border.
Exceptions
ArgumentNullExceptionThrown if rect is null.

◆ DrawFaceRect() [4/14]

static void DlibFaceLandmarkDetectorExample.OpenCVForUnityUtils.DrawFaceRect ( Mat imgMat,
double[] rect,
in Vec4d color,
int thickness )
static

Draws a rectangle and detection information on the specified image based on the provided rectangle data.

Parameters
imgMatThe Mat image on which to draw the rectangle and text.
rectAn array containing the rectangle data in the format [x, y, width, height, detection_confidence, weight_index]. The last two values are optional and used for displaying additional detection information.
colorThe Vec4d color of the rectangle border.
thicknessThe thickness of the rectangle border.
Exceptions
ArgumentNullExceptionThrown if rect is null.

◆ DrawFaceRect() [5/14]

static void DlibFaceLandmarkDetectorExample.OpenCVForUnityUtils.DrawFaceRect ( Mat imgMat,
double[] rect,
in(double v0, double v1, double v2, double v3) color,
int thickness )
static

Draws a rectangle and detection information on the specified image based on the provided rectangle data.

Parameters
imgMatThe Mat image on which to draw the rectangle and text.
rectAn array containing the rectangle data in the format [x, y, width, height, detection_confidence, weight_index]. The last two values are optional and used for displaying additional detection information.
colorThe ValueTuple<Double, Double, Double, Double> color of the rectangle border.
thicknessThe thickness of the rectangle border.
Exceptions
ArgumentNullExceptionThrown if rect is null.

◆ DrawFaceRect() [6/14]

static void DlibFaceLandmarkDetectorExample.OpenCVForUnityUtils.DrawFaceRect ( Mat imgMat,
double[] rect,
Scalar color,
int thickness )
static

Draws a rectangle and detection information on the specified image based on the provided rectangle data.

Parameters
imgMatThe Mat image on which to draw the rectangle and text.
rectAn array containing the rectangle data in the format [x, y, width, height, detection_confidence, weight_index]. The last two values are optional and used for displaying additional detection information.
colorThe Scalar color of the rectangle border.
thicknessThe thickness of the rectangle border.
Exceptions
ArgumentNullExceptionThrown if rect is null.

◆ DrawFaceRect() [7/14]

static void DlibFaceLandmarkDetectorExample.OpenCVForUnityUtils.DrawFaceRect ( Mat imgMat,
in Vec4d rect,
in Vec4d color,
int thickness )
static

Draws a rectangle on the specified image to indicate a detected face region.

Parameters
imgMatThe Mat image on which to draw the rectangle.
rectThe Vec4d defining the area to highlight.
colorThe Vec4d color of the rectangle border.
thicknessThe thickness of the rectangle border.

◆ DrawFaceRect() [8/14]

static void DlibFaceLandmarkDetectorExample.OpenCVForUnityUtils.DrawFaceRect ( Mat imgMat,
in Vec4i rect,
in Vec4d color,
int thickness )
static

Draws a rectangle on the specified image to indicate a detected face region.

Parameters
imgMatThe Mat image on which to draw the rectangle.
rectThe Vec4i defining the area to highlight.
colorThe Vec4d color of the rectangle border.
thicknessThe thickness of the rectangle border.

◆ DrawFaceRect() [9/14]

static void DlibFaceLandmarkDetectorExample.OpenCVForUnityUtils.DrawFaceRect ( Mat imgMat,
in(double x, double y, double width, double height) rect,
in(double v0, double v1, double v2, double v3) color,
int thickness )
static

Draws a rectangle on the specified image to indicate a detected face region.

Parameters
imgMatThe Mat image on which to draw the rectangle.
rectThe ValueTuple<Double, Double, Double, Double> defining the area to highlight.
colorThe ValueTuple<Double, Double, Double, Double> color of the rectangle border.
thicknessThe thickness of the rectangle border.

◆ DrawFaceRect() [10/14]

static void DlibFaceLandmarkDetectorExample.OpenCVForUnityUtils.DrawFaceRect ( Mat imgMat,
in(int x, int y, int width, int height) rect,
in(double v0, double v1, double v2, double v3) color,
int thickness )
static

Draws a rectangle on the specified image to indicate a detected face region.

Parameters
imgMatThe Mat image on which to draw the rectangle.
rectThe ValueTuple<Int32, Int32, Int32, Int32> defining the area to highlight.
colorThe ValueTuple<Double, Double, Double, Double> color of the rectangle border.
thicknessThe thickness of the rectangle border.

◆ DrawFaceRect() [11/14]

static void DlibFaceLandmarkDetectorExample.OpenCVForUnityUtils.DrawFaceRect ( Mat imgMat,
OpenCVForUnity.CoreModule.Rect rect,
Scalar color,
int thickness )
static

Draws a rectangle on the specified image to indicate a detected face region.

Parameters
imgMatThe Mat image on which to draw the rectangle.
rectThe OpenCVForUnity.CoreModule.Rect defining the area to highlight.
colorThe Scalar color of the rectangle border.
thicknessThe thickness of the rectangle border.

◆ DrawFaceRect() [12/14]

static void DlibFaceLandmarkDetectorExample.OpenCVForUnityUtils.DrawFaceRect ( Mat imgMat,
UnityEngine.Rect rect,
in Vec4d color,
int thickness )
static

Draws a rectangle on the specified image to indicate a detected face region.

Parameters
imgMatThe Mat image on which to draw the rectangle.
rectThe UnityEngine.Rect defining the area to highlight.
colorThe Vec4d color of the rectangle border.
thicknessThe thickness of the rectangle border.

◆ DrawFaceRect() [13/14]

static void DlibFaceLandmarkDetectorExample.OpenCVForUnityUtils.DrawFaceRect ( Mat imgMat,
UnityEngine.Rect rect,
in(double v0, double v1, double v2, double v3) color,
int thickness )
static

Draws a rectangle on the specified image to indicate a detected face region.

Parameters
imgMatThe Mat image on which to draw the rectangle.
rectThe UnityEngine.Rect defining the area to highlight.
colorThe ValueTuple<Double, Double, Double, Double> color of the rectangle border.
thicknessThe thickness of the rectangle border.

◆ DrawFaceRect() [14/14]

static void DlibFaceLandmarkDetectorExample.OpenCVForUnityUtils.DrawFaceRect ( Mat imgMat,
UnityEngine.Rect rect,
Scalar color,
int thickness )
static

Draws a rectangle on the specified image to indicate a detected face region.

Parameters
imgMatThe Mat image on which to draw the rectangle.
rectThe UnityEngine.Rect defining the area to highlight.
colorThe Scalar color of the rectangle border.
thicknessThe thickness of the rectangle border.

◆ SetImage()

static void DlibFaceLandmarkDetectorExample.OpenCVForUnityUtils.SetImage ( FaceLandmarkDetector faceLandmarkDetector,
Mat imgMat )
static

Sets the image for the specified FaceLandmarkDetector using a given Mat object.

Parameters
faceLandmarkDetectorAn instance of FaceLandmarkDetector that processes the specified image.
imgMatA Mat object representing the image to set. The matrix must be continuous and valid for processing.
Exceptions
ArgumentNullExceptionThrown if faceLandmarkDetector or imgMat is null.
ArgumentExceptionThrown if imgMat is not continuous. Ensure imgMat.isContinuous() == true.

This method directly assigns the imgMat data pointer, width, height, and element size to the specified FaceLandmarkDetector. It avoids additional memory allocations by reusing the existing imgMat data.

Member Data Documentation

◆ x

static double DlibFaceLandmarkDetectorExample.OpenCVForUnityUtils.x
static

Convert Vector2 list to ValueTuple array.

Convert Vec2d array to ValueTuple array.

Convert double array to ValueTuple array.

Convert Point list to ValueTuple array.

Parameters
srcList of Vector2.
dstArray of ValueTuple.
Returns
Array of ValueTuple.
Parameters
srcList of Point.
dstArray of ValueTuple.
Returns
Array of ValueTuple.
Parameters
srcArray of double.
dstArray of ValueTuple.
Returns
Array of ValueTuple.
Parameters
srcArray of Vec2d.
dstArray of ValueTuple.
Returns
Array of ValueTuple.

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