From 420271ef23302ebc475fcbb2b0721da10e2256d3 Mon Sep 17 00:00:00 2001 From: Tadas Baltrusaitis Date: Sat, 11 Nov 2017 09:14:45 +0000 Subject: [PATCH] Moving visualization out of landmark detection. --- .../include/LandmarkDetectorUtils.h | 7 ---- .../src/LandmarkDetectorUtils.cpp | 40 ------------------- 2 files changed, 47 deletions(-) diff --git a/lib/local/LandmarkDetector/include/LandmarkDetectorUtils.h b/lib/local/LandmarkDetector/include/LandmarkDetectorUtils.h index 26b1c97..8c9ae2d 100644 --- a/lib/local/LandmarkDetector/include/LandmarkDetectorUtils.h +++ b/lib/local/LandmarkDetector/include/LandmarkDetectorUtils.h @@ -81,13 +81,6 @@ namespace LandmarkDetector //=========================================================================== // Visualisation functions //=========================================================================== - void Project(cv::Mat_& dest, const cv::Mat_& mesh, double fx, double fy, double cx, double cy); - void DrawBox(cv::Mat image, cv::Vec6d pose, cv::Scalar color, int thickness, float fx, float fy, float cx, float cy); - - // Drawing face bounding box - vector> CalculateBox(cv::Vec6d pose, float fx, float fy, float cx, float cy); - void DrawBox(vector> lines, cv::Mat image, cv::Scalar color, int thickness); - vector CalculateVisibleLandmarks(const cv::Mat_& shape2D, const cv::Mat_& visibilities); vector CalculateVisibleLandmarks(const CLNF& clnf_model); vector CalculateVisibleEyeLandmarks(const CLNF& clnf_model); diff --git a/lib/local/LandmarkDetector/src/LandmarkDetectorUtils.cpp b/lib/local/LandmarkDetector/src/LandmarkDetectorUtils.cpp index 8c74925..2bce381 100644 --- a/lib/local/LandmarkDetector/src/LandmarkDetectorUtils.cpp +++ b/lib/local/LandmarkDetector/src/LandmarkDetectorUtils.cpp @@ -704,46 +704,6 @@ cv::Matx22d AlignShapesWithScale(cv::Mat_& src, cv::Mat_ dst) //=========================================================================== // Visualisation functions //=========================================================================== -void Project(cv::Mat_& dest, const cv::Mat_& mesh, double fx, double fy, double cx, double cy) -{ - dest = cv::Mat_(mesh.rows,2, 0.0); - - int num_points = mesh.rows; - - double X, Y, Z; - - - cv::Mat_::const_iterator mData = mesh.begin(); - cv::Mat_::iterator projected = dest.begin(); - - for(int i = 0;i < num_points; i++) - { - // Get the points - X = *(mData++); - Y = *(mData++); - Z = *(mData++); - - double x; - double y; - - // if depth is 0 the projection is different - if(Z != 0) - { - x = ((X * fx / Z) + cx); - y = ((Y * fy / Z) + cy); - } - else - { - x = X; - y = Y; - } - - // Project and store in dest matrix - (*projected++) = x; - (*projected++) = y; - } - -} void DrawBox(cv::Mat image, cv::Vec6d pose, cv::Scalar color, int thickness, float fx, float fy, float cx, float cy) {