Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. // load input image
  2. var img = Dlib.LoadImage<RgbPixel>(inputFilePath);
  3.  
  4. // find all faces in the image
  5. var faces = fd.Operator(img);
  6. foreach (var face in faces)
  7. {
  8. // find the landmark points for this face
  9. var shape = sp.Detect(img, face);
  10.  
  11. // draw the landmark points on the image
  12. for (var i = 0; i < shape.Parts; i++)
  13. {
  14. var point = shape.GetPart((uint)i);
  15. var rect = new Rectangle(point);
  16. Dlib.DrawRectangle(img, rect, color: new RgbPixel(255, 255, 0), thickness: 4);
  17. }
  18. }
  19.  
  20. // the rest of the code goes here....
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement