Skip to content

Commit

Permalink
Very minor changes to tracking
Browse files Browse the repository at this point in the history
  • Loading branch information
patrikhuber committed Jun 9, 2015
1 parent 23548b7 commit e37269f
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions examples/rcr/rcr-track.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,14 @@ using std::vector;
using std::cout;
using std::endl;

cv::Rect get_enclosing_bbox(cv::Mat landmarks)
template<class T = int>
cv::Rect_<T> get_enclosing_bbox(cv::Mat landmarks)
{
cv::Rect enclosing_bbox;
auto num_landmarks = landmarks.cols / 2;
double min_x_val, max_x_val, min_y_val, max_y_val;
cv::minMaxLoc(landmarks.colRange(0, num_landmarks), &min_x_val, &max_x_val);
cv::minMaxLoc(landmarks.colRange(num_landmarks, landmarks.cols), &min_y_val, &max_y_val);
return cv::Rect(min_x_val, min_y_val, max_x_val - min_x_val, max_y_val - min_y_val);
return cv::Rect_<T>(min_x_val, min_y_val, max_x_val - min_x_val, max_y_val - min_y_val);
};

/**
Expand Down Expand Up @@ -139,7 +139,7 @@ int main(int argc, char *argv[])
time_point<system_clock> start, end;

bool have_face = false;
Mat current_landmarks;
eos::core::LandmarkCollection<cv::Vec2f> current_landmarks;

for (;;)
{
Expand All @@ -160,11 +160,10 @@ int main(int argc, char *argv[])
cv::rectangle(image, detected_faces[0], { 255, 0, 0 });

start = system_clock::now();
auto landmarks = rcr_model.detect(image, detected_faces[0]);
current_landmarks = rcr_model.detect(image, detected_faces[0]);
end = system_clock::now();
auto t_fit = duration_cast<milliseconds>(end - start).count();

current_landmarks = rcr::to_row(landmarks);
rcr::draw_landmarks(image, current_landmarks);
//have_face = true;

Expand Down

0 comments on commit e37269f

Please sign in to comment.