get_key_landmarks: Get Key Facial Landmarks (5-Point)

View source: R/landmarks.R

get_key_landmarksR Documentation

Get Key Facial Landmarks (5-Point)

Description

Extracts the 5 key facial landmarks commonly used for face alignment: left eye, right eye, nose tip, left mouth corner, right mouth corner.

Usage

get_key_landmarks(img_path, detector = "retinaface")

Arguments

img_path

Path to the image file.

detector

Detector backend. "retinaface" provides these landmarks directly.

Details

These 5 landmarks are sufficient for basic face alignment and are commonly used in face recognition pipelines. For more detailed landmarks (478 points), use get_face_landmarks.

Value

A list with named landmark coordinates:

  • left_eye - (x, y) coordinates

  • right_eye - (x, y) coordinates

  • nose - (x, y) coordinates

  • mouth_left - (x, y) coordinates

  • mouth_right - (x, y) coordinates

Examples

## Not run: 
# Get key landmarks
lm <- get_key_landmarks("face.jpg")

# Calculate inter-pupillary distance
ipd <- sqrt(sum((lm$left_eye - lm$right_eye)^2))

## End(Not run)


r4lineups documentation built on Nov. 10, 2026, 1:08 a.m.