PyImageSearch / imutils

A series of convenience functions to make basic image processing operations such as translation, rotation, resizing, skeletonization, and displaying Matplotlib images easier with OpenCV and Python.
MIT License
4.51k stars 1.03k forks source link

Landmark Index Dict Consistency #250

Closed duwudi closed 2 years ago

duwudi commented 3 years ago

The 5-landmark dict has a different indexing definition. This makes it difficult to write code that works with both the 5-landmark and 68-landmark dlib detectors.

For example, this:

left_eye_start, left_eye_end = FACIAL_LANDMARKS_68_IDXS["left_eye"]
left_eye_landmarks = features[left_eye_start:left_eye_end]

is not the same as this:

left_eye_start, left_eye_end = FACIAL_LANDMARKS_5_IDXS["left_eye"]
left_eye_landmarks = features[left_eye_start:left_eye_end]

The latter only gives one of the left eye landmark positions, rather than both as desired

ritwikraha commented 2 years ago

Hey @duwudi thanks for this, this is being looked into at https://github.com/PyImageSearch/imutils/pull/249