From d568480faacc28a2d7a4ad62725486c27711385c Mon Sep 17 00:00:00 2001
From: Manuel Gunther <siebenkopf@googlemail.com>
Date: Mon, 6 Jun 2016 14:04:56 -0600
Subject: [PATCH] Added bounding box offset, which seems to be required to make
 the results compatible with OpenCV image processing

---
 bob/ip/flandmark/cpp/flandmark_detector.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/bob/ip/flandmark/cpp/flandmark_detector.cpp b/bob/ip/flandmark/cpp/flandmark_detector.cpp
index 50dbbce..085282f 100644
--- a/bob/ip/flandmark/cpp/flandmark_detector.cpp
+++ b/bob/ip/flandmark/cpp/flandmark_detector.cpp
@@ -942,8 +942,8 @@ void flandmark_get_normalized_image_frame(const blitz::Array<uint8_t, 2>& input,
   nd[0] = d[0]*model->data.options.bw_margin[1]/100. + d[0];
   nd[1] = d[1]*model->data.options.bw_margin[0]/100. + d[1];
 
-  corrected_bbx[0] = int(c[0] - nd[0]/2.);
-  corrected_bbx[1] = int(c[1] - nd[1]/2.);
+  corrected_bbx[0] = int(c[0] - nd[0]/2.) + 2;
+  corrected_bbx[1] = int(c[1] - nd[1]/2.) + 2;
   corrected_bbx[2] = int(c[0] + nd[0]/2.);
   corrected_bbx[3] = int(c[1] + nd[1]/2.);
 
-- 
GitLab