summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReynaldo H. Verdejo Pinochet <reynaldo@osg.samsung.com>2017-12-05 16:25:57 -0800
committerReynaldo H. Verdejo Pinochet <reynaldo@freedesktop.org>2019-04-17 15:48:41 -0700
commit969d32881c3d388eac60d6a99e792b3f1296e6fa (patch)
tree54a43eaa6d95937000635b6b47ccb1a8caafd94e
parent11b765b975abd0aee749fbc562c6d5893e86aa57 (diff)
opencv: facedetect: introduce fixed leaning damping factor
-rw-r--r--ext/opencv/gstfacedetect.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/ext/opencv/gstfacedetect.cpp b/ext/opencv/gstfacedetect.cpp
index 13f201dff..e78e4c43c 100644
--- a/ext/opencv/gstfacedetect.cpp
+++ b/ext/opencv/gstfacedetect.cpp
@@ -595,6 +595,7 @@ gst_face_detect_run_detector (GstFaceDetect * filter,
}
}
+#define LINEAR_DAMPING_FACTOR 5
/**
* @gst_face_detect_get_leaning_side
*
@@ -607,6 +608,9 @@ static inline void
gst_face_detect_get_leaning_side (guint *side, gint reference, gint position) {
g_assert (side);
+ if (ABS (position - reference) < LINEAR_DAMPING_FACTOR)
+ return;
+
if (position > reference)
*side = DIRECTION_LEFT;
else if (position < reference)