summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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)