diff options
Diffstat (limited to 'mv_face/face')
-rw-r--r-- | mv_face/face/src/FaceEyeCondition.cpp | 8 | ||||
-rw-r--r-- | mv_face/face/src/FaceRecognitionModel.cpp | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/mv_face/face/src/FaceEyeCondition.cpp b/mv_face/face/src/FaceEyeCondition.cpp index 53c835ba..22039405 100644 --- a/mv_face/face/src/FaceEyeCondition.cpp +++ b/mv_face/face/src/FaceEyeCondition.cpp @@ -64,13 +64,13 @@ void FaceEyeCondition::splitEyes( const double xRightEyeCenter = (2 * eyeAreaRight.x + eyeAreaRight.width) / 2.; const double yRightEyeCenter = (2 * eyeAreaRight.y + eyeAreaRight.height) / 2.; - const cv::Rect leftEyeRect(xLeftEyeCenter - eyeAreaLeft.width / 4, - yLeftEyeCenter - eyeAreaLeft.height / 4, + const cv::Rect leftEyeRect((int)(xLeftEyeCenter - (double)eyeAreaLeft.width / 4), + (int)(yLeftEyeCenter - (double)eyeAreaLeft.height / 4), eyeAreaLeft.width / 2, eyeAreaLeft.height / 2); - const cv::Rect rightEyeRect(xRightEyeCenter - eyeAreaRight.width / 4, - yRightEyeCenter - eyeAreaRight.height / 4, + const cv::Rect rightEyeRect((int)(xRightEyeCenter - (double)eyeAreaRight.width / 4), + (int)(yRightEyeCenter - (double)eyeAreaRight.height / 4), eyeAreaRight.width / 2, eyeAreaRight.height / 2); diff --git a/mv_face/face/src/FaceRecognitionModel.cpp b/mv_face/face/src/FaceRecognitionModel.cpp index 1c0c55c4..394e067a 100644 --- a/mv_face/face/src/FaceRecognitionModel.cpp +++ b/mv_face/face/src/FaceRecognitionModel.cpp @@ -38,7 +38,7 @@ int CopyOpenCVAlgorithmParameters(const cv::Ptr<cv::FaceRecognizer>& srcAlg, { char tempPath[1024]; - sprintf(tempPath, "/tmp/alg_copy_%p_%p", srcAlg.obj, dstAlg.obj); + snprintf(tempPath, 1024, "/tmp/alg_copy_%p_%p", srcAlg.obj, dstAlg.obj); srcAlg->save(tempPath); dstAlg->load(tempPath); |