shape_predictor_81_face_landmarks | Custom shape predictor model trained to find | Machine Learning library
kandi X-RAY | shape_predictor_81_face_landmarks Summary
kandi X-RAY | shape_predictor_81_face_landmarks Summary
81 Facial Landmarks Shape Predictor.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of shape_predictor_81_face_landmarks
shape_predictor_81_face_landmarks Key Features
shape_predictor_81_face_landmarks Examples and Code Snippets
Community Discussions
Trending Discussions on shape_predictor_81_face_landmarks
QUESTION
I am using landmark points from dlib library to select the forehead, nose and eye area from my face based on this question: Is there a way to get the area of the forehead (bounding box) by using opencv/dlib and for a live stream video. It works like a charm and i have the points exactly where i want them, what i would like to do is crop the image where the landmarks are set using convexhull polygons.
What i am trying to do is go from this:
to this:
And save it afterwards
Is there a any way to do it? even if it doesn't look pretty. Here's my current code for facial tracking:
...ANSWER
Answered 2021-Feb-23 at 06:43You selected only a subset of the 81 landmarks dlib identifies on a face, and discarded the landmarks associated with the mouth, chin and the outer contour of the face.
You should do an additional selection leaving only the points at the boundary of the region you are interested in. Furthermore, you should order the selected points such that connecting them, in the right order, will form a polygon marking exactly the region you want to crop.
Once you have the polygon you can use this method to crop it:
- Use
cv2.fillPoly()
to draw mask from the polygon. - Get only the cropped polygon portion of the mask from the image using
cv2.bitwsie_and()
. - Get the bounding rect of the cropped region using
cv2.boundingRect()
.
QUESTION
I've been working on a project to get the forehead area from a live streaming video and not just use and image and crop the forehead like from this example How can i detect the forehead region using opencv and dlib?.
...ANSWER
Answered 2020-Sep-07 at 07:50you already find the desired coordinates by:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install shape_predictor_81_face_landmarks
You can use shape_predictor_81_face_landmarks like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page