Dlib FaceLandmark Detector
1.4.0
Enox Software
|
Face landmark detector. More...
Classes | |
class | RectDetection |
Public Member Functions | |
FaceLandmarkDetector (string shapePredictorFilePath) | |
FaceLandmarkDetector (string objectDetectorFilePath, string shapePredictorFilePath) | |
void | SetImage (Texture2D texture2D) |
void | SetImage (WebCamTexture webCamTexture) |
void | SetImage (WebCamTexture webCamTexture, Color32[] pixels32Buffer) |
void | SetImage (IntPtr intPtr, int width, int height, int bytesPerPixel) |
void | SetImage (IntPtr intPtr, int width, int height, int bytesPerPixel, bool flip) |
void | SetImage< T > (T[] array, int width, int height, int bytesPerPixel) |
void | SetImage< T > (T[] array, int width, int height, int bytesPerPixel, bool flip) |
List< Rect > | Detect () |
List< Rect > | Detect (double adjust_threshold) |
List< RectDetection > | DetectRectDetection () |
List< RectDetection > | DetectRectDetection (double adjust_threshold) |
double [] | DetectArray () |
double [] | DetectArray (double adjust_threshold) |
int | DetectOnly () |
int | DetectOnly (double adjust_threshold) |
void | GetDetectResult (double[] result) |
void | GetDetectResult (Span< double > result) |
List< Vector2 > | DetectLandmark (double left, double top, double width, double height) |
List< Vector2 > | DetectLandmark (Rect rect) |
double [] | DetectLandmarkArray (double left, double top, double width, double height) |
double [] | DetectLandmarkArray (Rect rect) |
int | DetectLandmarkOnly (double left, double top, double width, double height) |
int | DetectLandmarkOnly (Rect rect) |
void | GetDetectLandmarkResult (double[] result) |
void | GetDetectLandmarkResult (Span< double > result) |
bool | IsAllPartsInRect () |
long | GetShapePredictorNumParts () |
long | GetShapePredictorNumFeatures () |
void | DrawDetectResult (Texture2D texture2D, int r, int g, int b, int a, int thickness, bool updateMipmaps=false, bool makeNoLongerReadable=false) |
void | DrawDetectResult (Texture2D texture2D, int r, int g, int b, int a, int thickness, Color32[] pixels32Buffer, byte[] rawTextureDataBuffer=null, bool updateMipmaps=false, bool makeNoLongerReadable=false) |
void | DrawDetectResult (IntPtr intPtr, int width, int height, int bytesPerPixel, int r, int g, int b, int a, int thickness) |
void | DrawDetectResult (IntPtr intPtr, int width, int height, int bytesPerPixel, bool flip, int r, int g, int b, int a, int thickness) |
void | DrawDetectResult< T > (T[] array, int width, int height, int bytesPerPixel, int r, int g, int b, int a, int thickness) |
void | DrawDetectResult< T > (T[] array, int width, int height, int bytesPerPixel, bool flip, int r, int g, int b, int a, int thickness) |
void | DrawDetectLandmarkResult (Texture2D texture2D, int r, int g, int b, int a, bool updateMipmaps=false, bool makeNoLongerReadable=false) |
void | DrawDetectLandmarkResult (Texture2D texture2D, int r, int g, int b, int a, Color32[] pixels32Buffer, byte[] rawTextureDataBuffer=null, bool updateMipmaps=false, bool makeNoLongerReadable=false) |
void | DrawDetectLandmarkResult (IntPtr intPtr, int width, int height, int bytesPerPixel, int r, int g, int b, int a) |
void | DrawDetectLandmarkResult (IntPtr intPtr, int width, int height, int bytesPerPixel, bool flip, int r, int g, int b, int a) |
void | DrawDetectLandmarkResult< T > (T[] array, int width, int height, int bytesPerPixel, int r, int g, int b, int a) |
void | DrawDetectLandmarkResult< T > (T[] array, int width, int height, int bytesPerPixel, bool flip, int r, int g, int b, int a) |
Public Member Functions inherited from DlibFaceLandmarkDetector.DisposableObject | |
void | Dispose () |
void | ThrowIfDisposed () |
Protected Member Functions | |
override void | Dispose (bool disposing) |
Protected Member Functions inherited from DlibFaceLandmarkDetector.DisposableDlibObject | |
DisposableDlibObject () | |
DisposableDlibObject (IntPtr ptr) | |
DisposableDlibObject (bool isEnabledDispose) | |
DisposableDlibObject (IntPtr ptr, bool isEnabledDispose) | |
Protected Member Functions inherited from DlibFaceLandmarkDetector.DisposableObject | |
DisposableObject () | |
DisposableObject (bool isEnabledDispose) | |
Additional Inherited Members | |
Properties inherited from DlibFaceLandmarkDetector.DisposableObject | |
bool | IsDisposed [get, protected set] |
bool | IsEnabledDispose [get, set] |
Face landmark detector.
DlibFaceLandmarkDetector.FaceLandmarkDetector.FaceLandmarkDetector | ( | string | shapePredictorFilePath | ) |
Initializes a new instance of the FaceLandmarkDetector class.
This instance uses default frontal face detector.
ObjectDetector is initialized in such a code. frontal_face_detector face_detector; face_detector = get_frontal_face_detector();
ShapePredictor is initialized in such a code. shape_predictor sp; deserialize(shape_predictor_filename) >> sp;
shapePredictorFilePath |
DlibFaceLandmarkDetector.FaceLandmarkDetector.FaceLandmarkDetector | ( | string | objectDetectorFilePath, |
string | shapePredictorFilePath | ||
) |
Initializes a new instance of the FaceLandmarkDetector class.
ObjectDetector is initialized in such a code. if(object_detector_filename != null){ object_detector<scan_fhog_pyramid<pyramid_down<6>>> simple_detector; deserialize(object_detector_filename) >> simple_detector; }else{ frontal_face_detector face_detector; face_detector = get_frontal_face_detector(); }
ShapePredictor is initialized in such a code. shape_predictor sp; deserialize(shape_predictor_filename) >> sp;
objectDetectorFilePath | |
shapePredictorFilePath |
List<Rect> DlibFaceLandmarkDetector.FaceLandmarkDetector.Detect | ( | ) |
Detects Objects.
List<Rect> DlibFaceLandmarkDetector.FaceLandmarkDetector.Detect | ( | double | adjust_threshold | ) |
Detects Objects.
adjust_threshold |
double [] DlibFaceLandmarkDetector.FaceLandmarkDetector.DetectArray | ( | ) |
Detects Objects.
double [] DlibFaceLandmarkDetector.FaceLandmarkDetector.DetectArray | ( | double | adjust_threshold | ) |
Detects Objects.
adjust_threshold |
List<Vector2> DlibFaceLandmarkDetector.FaceLandmarkDetector.DetectLandmark | ( | double | left, |
double | top, | ||
double | width, | ||
double | height | ||
) |
Detects Object Landmark.
left | |
top | |
width | |
height |
List<Vector2> DlibFaceLandmarkDetector.FaceLandmarkDetector.DetectLandmark | ( | Rect | rect | ) |
Detects Object Landmark.
rect |
double [] DlibFaceLandmarkDetector.FaceLandmarkDetector.DetectLandmarkArray | ( | double | left, |
double | top, | ||
double | width, | ||
double | height | ||
) |
Detects Object Landmark.
left | |
top | |
width | |
height |
double [] DlibFaceLandmarkDetector.FaceLandmarkDetector.DetectLandmarkArray | ( | Rect | rect | ) |
Detects Object Landmark.
rect |
int DlibFaceLandmarkDetector.FaceLandmarkDetector.DetectLandmarkOnly | ( | double | left, |
double | top, | ||
double | width, | ||
double | height | ||
) |
Detects Objects and returns the number of Objects Landmark.
left | |
top | |
width | |
height |
int DlibFaceLandmarkDetector.FaceLandmarkDetector.DetectLandmarkOnly | ( | Rect | rect | ) |
Detects Objects and returns the number of Objects Landmark.
rect |
int DlibFaceLandmarkDetector.FaceLandmarkDetector.DetectOnly | ( | ) |
Detects Objects and returns the number of Objects detected.
int DlibFaceLandmarkDetector.FaceLandmarkDetector.DetectOnly | ( | double | adjust_threshold | ) |
Detects Objects and returns the number of Objects detected.
adjust_threshold |
List<RectDetection> DlibFaceLandmarkDetector.FaceLandmarkDetector.DetectRectDetection | ( | ) |
Detects Objects.
List<RectDetection> DlibFaceLandmarkDetector.FaceLandmarkDetector.DetectRectDetection | ( | double | adjust_threshold | ) |
Detects Objects.
adjust_threshold |
|
protectedvirtual |
Reimplemented from DlibFaceLandmarkDetector.DisposableDlibObject.
void DlibFaceLandmarkDetector.FaceLandmarkDetector.DrawDetectLandmarkResult | ( | Texture2D | texture2D, |
int | r, | ||
int | g, | ||
int | b, | ||
int | a, | ||
bool | updateMipmaps = false , |
||
bool | makeNoLongerReadable = false |
||
) |
Draws Detect Landmark Result.
texture2D | |
r | |
g | |
a | |
updateMipmaps | when set to true, mipmap levels are recalculated. |
makeNoLongerReadable | when set to true, system memory copy of a texture is released. |
void DlibFaceLandmarkDetector.FaceLandmarkDetector.DrawDetectLandmarkResult | ( | Texture2D | texture2D, |
int | r, | ||
int | g, | ||
int | b, | ||
int | a, | ||
Color32 [] | pixels32Buffer, | ||
byte [] | rawTextureDataBuffer = null , |
||
bool | updateMipmaps = false , |
||
bool | makeNoLongerReadable = false |
||
) |
Draws Detect Landmark Result.
texture2D | Processing speed is fastest when TextureFormat is RGBA32, RGB24, or Alpha8. |
r | |
g | |
b | |
a | |
pixels32Buffer | the optional array to receive pixels32 data. You can optionally pass in an array of Color32s to avoid allocating new memory each frame. The array needs to be initialized to a length matching width * height of the texture. (http://docs.unity3d.com/ScriptReference/WebCamTexture.GetPixels32.html) |
rawTextureDataBuffer | the optional array to receive raw texture data. You can optionally pass in an array of bytes to avoid allocating new memory each frame. The array needs to be initialized to a length matching raw data of the texture. (https://docs.unity3d.com/ScriptReference/Texture2D.GetRawTextureData.html) |
updateMipmaps | when set to true, mipmap levels are recalculated. |
makeNoLongerReadable | when set to true, system memory copy of a texture is released. |
void DlibFaceLandmarkDetector.FaceLandmarkDetector.DrawDetectLandmarkResult | ( | IntPtr | intPtr, |
int | width, | ||
int | height, | ||
int | bytesPerPixel, | ||
int | r, | ||
int | g, | ||
int | b, | ||
int | a | ||
) |
Draws Detect Landmark Result.
intPtr | |
width | |
height | |
bytesPerPixel | 1 ,3 or 4 |
r | |
g | |
b | |
a |
void DlibFaceLandmarkDetector.FaceLandmarkDetector.DrawDetectLandmarkResult | ( | IntPtr | intPtr, |
int | width, | ||
int | height, | ||
int | bytesPerPixel, | ||
bool | flip, | ||
int | r, | ||
int | g, | ||
int | b, | ||
int | a | ||
) |
Draws Detect Landmark Result.
intPtr | |
width | |
height | |
bytesPerPixel | 1 , 3 or 4 |
flip | flip vertical |
r | |
g | |
b | |
a |
void DlibFaceLandmarkDetector.FaceLandmarkDetector.DrawDetectLandmarkResult< T > | ( | T [] | array, |
int | width, | ||
int | height, | ||
int | bytesPerPixel, | ||
int | r, | ||
int | g, | ||
int | b, | ||
int | a | ||
) |
Draws Detect Landmark Result.
array | |
width | |
height | |
bytesPerPixel | 1 , 3 or 4 |
r | |
g | |
b | |
a |
T | : | struct |
void DlibFaceLandmarkDetector.FaceLandmarkDetector.DrawDetectLandmarkResult< T > | ( | T [] | array, |
int | width, | ||
int | height, | ||
int | bytesPerPixel, | ||
bool | flip, | ||
int | r, | ||
int | g, | ||
int | b, | ||
int | a | ||
) |
Draws Detect Landmark Result.
array | |
width | |
height | 1 , 3 or 4 flip vertical |
r | |
g | |
b | |
a |
T | : | struct |
void DlibFaceLandmarkDetector.FaceLandmarkDetector.DrawDetectResult | ( | Texture2D | texture2D, |
int | r, | ||
int | g, | ||
int | b, | ||
int | a, | ||
int | thickness, | ||
bool | updateMipmaps = false , |
||
bool | makeNoLongerReadable = false |
||
) |
Draws Detect Result.
texture2D | |
r | |
g | |
b | |
a | |
thickness | |
updateMipmaps | when set to true, mipmap levels are recalculated. |
makeNoLongerReadable | when set to true, system memory copy of a texture is released. |
void DlibFaceLandmarkDetector.FaceLandmarkDetector.DrawDetectResult | ( | Texture2D | texture2D, |
int | r, | ||
int | g, | ||
int | b, | ||
int | a, | ||
int | thickness, | ||
Color32 [] | pixels32Buffer, | ||
byte [] | rawTextureDataBuffer = null , |
||
bool | updateMipmaps = false , |
||
bool | makeNoLongerReadable = false |
||
) |
Draws Detect Result.
texture2D | Processing speed is fastest when TextureFormat is RGBA32, RGB24, or Alpha8. |
r | |
g | |
b | |
a | |
thickness | |
pixels32Buffer | the optional array to receive pixels32 data. You can optionally pass in an array of Color32s to avoid allocating new memory each frame. The array needs to be initialized to a length matching width * height of the texture. (http://docs.unity3d.com/ScriptReference/WebCamTexture.GetPixels32.html) |
rawTextureDataBuffer | the optional array to receive raw texture data. You can optionally pass in an array of bytes to avoid allocating new memory each frame. The array needs to be initialized to a length matching raw data of the texture. (https://docs.unity3d.com/ScriptReference/Texture2D.GetRawTextureData.html) |
updateMipmaps | when set to true, mipmap levels are recalculated. |
makeNoLongerReadable | when set to true, system memory copy of a texture is released. |
void DlibFaceLandmarkDetector.FaceLandmarkDetector.DrawDetectResult | ( | IntPtr | intPtr, |
int | width, | ||
int | height, | ||
int | bytesPerPixel, | ||
int | r, | ||
int | g, | ||
int | b, | ||
int | a, | ||
int | thickness | ||
) |
Draws Detect Result.
intPtr | |
width | |
height | 1 , 3 or 4 |
r | |
g | |
b | |
a | |
thickness |
void DlibFaceLandmarkDetector.FaceLandmarkDetector.DrawDetectResult | ( | IntPtr | intPtr, |
int | width, | ||
int | height, | ||
int | bytesPerPixel, | ||
bool | flip, | ||
int | r, | ||
int | g, | ||
int | b, | ||
int | a, | ||
int | thickness | ||
) |
Draws Detect Result.
intPtr | |
width | |
height | |
bytesPerPixel | 1 , 3 or 4 |
flip | flip vertical |
r | |
g | |
b | |
a | |
thickness |
void DlibFaceLandmarkDetector.FaceLandmarkDetector.DrawDetectResult< T > | ( | T [] | array, |
int | width, | ||
int | height, | ||
int | bytesPerPixel, | ||
int | r, | ||
int | g, | ||
int | b, | ||
int | a, | ||
int | thickness | ||
) |
Draws Detect Result.
array | |
width | |
height | |
bytesPerPixel | 1 , 3 or 4 |
r | |
g | |
b | |
a | |
thickness |
T | : | struct |
void DlibFaceLandmarkDetector.FaceLandmarkDetector.DrawDetectResult< T > | ( | T [] | array, |
int | width, | ||
int | height, | ||
int | bytesPerPixel, | ||
bool | flip, | ||
int | r, | ||
int | g, | ||
int | b, | ||
int | a, | ||
int | thickness | ||
) |
Draws Detect Result.
array | |
width | |
height | |
bytePerPixel | 1 , 3 or 4 |
flip | flip vertical |
r | |
g | |
b | |
a | |
thickness |
T | : | struct |
void DlibFaceLandmarkDetector.FaceLandmarkDetector.GetDetectLandmarkResult | ( | double [] | result | ) |
Get the result data of the Objects Landmark detected by the DetectLandmarkOnly() method, passing a data size of DetectLandmarkOnly() * 2 as an argument. This method can retrieve results without memory allocation.
result | detected object landmark data.[x_0, y_0, x_1, y_1, ...] |
void DlibFaceLandmarkDetector.FaceLandmarkDetector.GetDetectLandmarkResult | ( | Span< double > | result | ) |
Get the result data of the Objects Landmark detected by the DetectLandmarkOnly() method, passing a data size of DetectLandmarkOnly() * 2 as an argument. This method can retrieve results without memory allocation.
result | detected object landmark data.[x_0, y_0, x_1, y_1, ...] |
void DlibFaceLandmarkDetector.FaceLandmarkDetector.GetDetectResult | ( | double [] | result | ) |
Get the result data of the Objects detected by the DetectOnly() method, passing a data size of DetectOnly() * 6 as an argument. This method can retrieve results without memory allocation.
result | detected object's data.[left_0, top_0, width_0, height_0, detection_confidence_0, weight_index_0, left_1, top_1, width_1, height_1, detection_confidence_1, weight_index_1, ...] |
void DlibFaceLandmarkDetector.FaceLandmarkDetector.GetDetectResult | ( | Span< double > | result | ) |
Get the result data of the Objects detected by the DetectOnly() method, passing a data size of DetectOnly() * 6 as an argument. This method can retrieve results without memory allocation.
result | detected object's data.[left_0, top_0, width_0, height_0, detection_confidence_0, weight_index_0, left_1, top_1, width_1, height_1, detection_confidence_1, weight_index_1, ...] |
long DlibFaceLandmarkDetector.FaceLandmarkDetector.GetShapePredictorNumFeatures | ( | ) |
Gets ShapePredictorNumFeatures.
long DlibFaceLandmarkDetector.FaceLandmarkDetector.GetShapePredictorNumParts | ( | ) |
Gets ShapePredictorNumParts.
bool DlibFaceLandmarkDetector.FaceLandmarkDetector.IsAllPartsInRect | ( | ) |
Whether all of the object parts point is contained in the object rectangle?
void DlibFaceLandmarkDetector.FaceLandmarkDetector.SetImage | ( | Texture2D | texture2D | ) |
Sets Image from Texture2D.
texture2D | Processing speed is fastest when TextureFormat is RGBA32, RGB24, or Alpha8. |
void DlibFaceLandmarkDetector.FaceLandmarkDetector.SetImage | ( | WebCamTexture | webCamTexture | ) |
Sets Image from WebCamTexture.
webCamTexture |
void DlibFaceLandmarkDetector.FaceLandmarkDetector.SetImage | ( | WebCamTexture | webCamTexture, |
Color32 [] | pixels32Buffer | ||
) |
Sets Image from WebCamTexture.
webCamTexture | |
pixels32Buffer | the optional array to receive pixel data. You can optionally pass in an array of Color32s to avoid allocating new memory each frame. The array needs to be initialized to a length matching width * height of the texture.(http://docs.unity3d.com/ScriptReference/WebCamTexture.GetPixels32.html) |
void DlibFaceLandmarkDetector.FaceLandmarkDetector.SetImage | ( | IntPtr | intPtr, |
int | width, | ||
int | height, | ||
int | bytesPerPixel | ||
) |
Sets Image from IntPtr.
intPtr | |
width | |
height | |
bytesPerPixel | 1 , 3 or 4 |
void DlibFaceLandmarkDetector.FaceLandmarkDetector.SetImage | ( | IntPtr | intPtr, |
int | width, | ||
int | height, | ||
int | bytesPerPixel, | ||
bool | flip | ||
) |
Sets Image from IntPtr.
intPtr | |
width | |
height | |
bytesPerPixel | 1 , 3 or 4 |
flip | flip vertical |
void DlibFaceLandmarkDetector.FaceLandmarkDetector.SetImage< T > | ( | T [] | array, |
int | width, | ||
int | height, | ||
int | bytesPerPixel | ||
) |
Sets Image from Pixel Data Array.
array | |
width | |
height | |
bytesPerPixel | 1 , 3 or 4 |
T | : | unmanaged |
void DlibFaceLandmarkDetector.FaceLandmarkDetector.SetImage< T > | ( | T [] | array, |
int | width, | ||
int | height, | ||
int | bytesPerPixel, | ||
bool | flip | ||
) |
Sets Image from Pixel Data Array.
array | |
width | |
height | |
bytesPerPixel | 1 , 3 or 4 |
flip | flip vertical |
T | : | unmanaged |