teratail header banner
teratail header banner
質問するログイン新規登録

回答編集履歴

2

d

2020/10/29 03:43

投稿

tiitoi
tiitoi

スコア21960

answer CHANGED
@@ -10,7 +10,7 @@
10
10
  # 検出する。
11
11
  faces = face_cascade.detectMultiScale(gray)
12
12
 
13
- if len(face) > 0:
13
+ if len(faces) > 0:
14
14
  max_face = max(faces, key=lambda x: x[2] * x[3])
15
15
 
16
16
  # 矩形を画像に描画する。

1

d

2020/10/29 03:43

投稿

tiitoi
tiitoi

スコア21960

answer CHANGED
@@ -10,7 +10,7 @@
10
10
  # 検出する。
11
11
  faces = face_cascade.detectMultiScale(gray)
12
12
 
13
- if len(face) == 0:
13
+ if len(face) > 0:
14
14
  max_face = max(faces, key=lambda x: x[2] * x[3])
15
15
 
16
16
  # 矩形を画像に描画する。