Help us understand the problem. What is going on with this article?

imutilsの使い方

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)

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

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした