Ask Your Question

How to avoid detecting small and blurry face with haarcascade?

asked 2018-09-27 23:01:23 -0500

akmalhakimi1919 gravatar image


I'm making a Facial Recognition program that uses IP Cam to recognized people in my office. I put the camera near the entrance door. The program uses opencv and haarcascade to detect face and once face is detected, it will send the face to AWS Rekognition to be recognized. However, the program keeps on capturing blurry and small faces. The "small" and "blurry" image is due to people entering the camera frame and moving towards the camera. By the time the recognition process finish, the person already left the camera view.

So my question is, is there any way for OpenCV or Haarcascade to set a minimum width of face that it detects?

edit retag flag offensive close merge delete


oh my what if you just read the docs ?

berak gravatar imageberak ( 2018-09-28 00:05:28 -0500 )edit

1 answer

Sort by ยป oldest newest most voted

answered 2018-09-28 11:17:46 -0500

berak gravatar image

updated 2018-09-28 11:19:54 -0500

CascadeClassifier::detectMultiscale has a minSize param which should do exactly, what you wanted.

LESSON: read docs, before asking questions.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower


Asked: 2018-09-27 23:01:23 -0500

Seen: 225 times

Last updated: Sep 28 '18