0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

imutilsの使い方

Posted at

imutilsとは?

どんな人向けか

face detectionを行う人とか。ハードコーディングっぽく見えなくなるのが良い。
例えば、imutilsを使わなければ、

point_idxs = [
     1,  # right ear 
     3,  # right cheak1 
     4,  # right cheak2 
     33,  # nose top 
     12,  # left cheak1
     13,  # left cheak2 
     15,  # left ear 
     28,  # nose line 
 ] 
warp_points = [0, 2, 4, 6] 

としていたものを、

from imutil import face_util
(lStart, lEnd) = face_utils.FACIAL_LANDMARKS_IDXS["left_eye"]
(rStart, rEnd) = face_utils.FACIAL_LANDMARKS_IDXS["right_eye"]
(mStart, mEnd) = face_utils.FACIAL_LANDMARKS_IDXS["mouth"]

とできるし、

shape = predictor(gray, rects[0])
shape = face_utils.shape_to_np(shape)

とできてしまう。

frame = imutils.resize(frame, width=450)

ただ、余計なライブラリが増えるというデメリットがある。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?