From 82db59076bfb200bf80782ec26c9a38efdf22766 Mon Sep 17 00:00:00 2001 From: Raffaele Colombo Date: Mon, 5 Feb 2024 10:02:50 +0100 Subject: [PATCH] right eye is flipped on the vertic axis wrt --- aux_modules/faceExpression/eyesThread.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/aux_modules/faceExpression/eyesThread.cpp b/aux_modules/faceExpression/eyesThread.cpp index fc3beaa..503b0d8 100644 --- a/aux_modules/faceExpression/eyesThread.cpp +++ b/aux_modules/faceExpression/eyesThread.cpp @@ -107,7 +107,9 @@ bool EyesThread::threadInit() // Copy eyes ((Mat)blinkEye[indexes[0]]).copyTo(faceRest(cv::Rect(leftEye_x, leftEye_y, eyeWidth, eyeHeight))); - ((Mat)blinkEye[indexes[0]]).copyTo(faceRest(cv::Rect(rightEye_x, rightEye_y, eyeWidth, eyeHeight))); + cv::Mat flippedEye; + cv::flip(blinkEye[indexes[index]], flippedEye, 1); // flipping the right eye on its vertical axis + flippedEye.copyTo(faceRest(cv::Rect(rightEye_x, rightEye_y, eyeWidth, eyeHeight))); // Add nose noseBar.copyTo(faceRest(cv::Rect(noseBar0_x, noseBar0_y, noseBar.cols, noseBar.rows))); @@ -188,7 +190,9 @@ bool EyesThread::updateBlink(int index) // Copy eyes ((Mat)blinkEye[indexes[index]]).copyTo(m_face(cv::Rect(leftEye_x, leftEye_y, eyeWidth, eyeHeight))); - ((Mat)blinkEye[indexes[index]]).copyTo(m_face(cv::Rect(rightEye_x, rightEye_y, eyeWidth, eyeHeight))); + cv::Mat flippedEye; + cv::flip(blinkEye[indexes[index]], flippedEye, 1); // flipping the right eye on its vertical axis + flippedEye.copyTo(m_face(cv::Rect(rightEye_x, rightEye_y, eyeWidth, eyeHeight))); // Add nose noseBar.copyTo(m_face(cv::Rect(noseBar0_x, noseBar0_y, noseBar.cols, noseBar.rows)));