From cc445067d1f61e12dbea4e6458f2c85ba58f01bf Mon Sep 17 00:00:00 2001
From: houxiao <houxiao@454eff88-639b-444f-9e54-f578c98de674>
Date: 星期五, 30 十二月 2016 14:28:14 +0800
Subject: [PATCH] fix config, fix some log and todo
---
RtspFace/demo/src/sample_face_track.cpp | 35 +++++++++++++++++------------------
1 files changed, 17 insertions(+), 18 deletions(-)
diff --git a/RtspFace/demo/src/sample_face_track.cpp b/RtspFace/demo/src/sample_face_track.cpp
index 69781fe..2d01890 100644
--- a/RtspFace/demo/src/sample_face_track.cpp
+++ b/RtspFace/demo/src/sample_face_track.cpp
@@ -7,7 +7,8 @@
using namespace std;
using namespace cv;
-int main(int argc, char *argv[]) {
+int main(int argc, char *argv[])
+{
if (argc < 2) {
fprintf(stderr, "test_sample_face_track [alignment point size(21 or 106)] [detect face cont limit]\n");
fprintf(stderr, "for example: \"test_sample_face_track 21 1\"\n");
@@ -28,11 +29,9 @@
int config;
if (point_size == 21) {
config = CV_DETECT_ENABLE_ALIGN_21;
- }
- else if (point_size == 106) {
+ } else if (point_size == 106) {
config = CV_DETECT_ENABLE_ALIGN_106;
- }
- else {
+ } else {
fprintf(stderr, "alignment point size must be 21 or 106\n");
return -1;
}
@@ -67,12 +66,12 @@
int face_count = 0;
while (capture.read(bgr_frame)) { // CV_PIX_FMT_BGR888
resize(bgr_frame, bgr_frame, Size(frame_width, frame_height), 0, 0,
- INTER_LINEAR);
+ INTER_LINEAR);
// realtime track
face_count = 0;
cv_result = cv_face_track(handle_track, bgr_frame.data, CV_PIX_FMT_BGR888,
- bgr_frame.cols, bgr_frame.rows, bgr_frame.step,
- CV_FACE_UP, &p_face, &face_count);
+ bgr_frame.cols, bgr_frame.rows, bgr_frame.step,
+ CV_FACE_UP, &p_face, &face_count);
if (cv_result != CV_OK) {
fprintf(stderr, "cv_face_track failed, error : %d\n", cv_result);
cv_face_release_tracker_result(p_face, face_count);
@@ -81,23 +80,23 @@
for (int i = 0; i < face_count; i++) {
fprintf(stderr, "face: %d-----[%d, %d, %d, %d]-----id: %d\n", i,
- p_face[i].rect.left, p_face[i].rect.top,
- p_face[i].rect.right, p_face[i].rect.bottom, p_face[i].ID);
+ p_face[i].rect.left, p_face[i].rect.top,
+ p_face[i].rect.right, p_face[i].rect.bottom, p_face[i].ID);
fprintf(stderr, "face pose: [yaw: %.2f, pitch: %.2f, roll: %.2f, eye distance: %.2f]\n",
- p_face[i].yaw,
- p_face[i].pitch, p_face[i].roll, p_face[i].eye_dist);
+ p_face[i].yaw,
+ p_face[i].pitch, p_face[i].roll, p_face[i].eye_dist);
// draw the video
Scalar scalar_color = CV_RGB(p_face[i].ID * 53 % 256,
- p_face[i].ID * 93 % 256,
- p_face[i].ID * 143 % 256);
+ p_face[i].ID * 93 % 256,
+ p_face[i].ID * 143 % 256);
rectangle(bgr_frame, Point2f(static_cast<float>(p_face[i].rect.left),
- static_cast<float>(p_face[i].rect.top)),
- Point2f(static_cast<float>(p_face[i].rect.right),
- static_cast<float>(p_face[i].rect.bottom)), scalar_color, 2);
+ static_cast<float>(p_face[i].rect.top)),
+ Point2f(static_cast<float>(p_face[i].rect.right),
+ static_cast<float>(p_face[i].rect.bottom)), scalar_color, 2);
for (int j = 0; j < p_face[i].points_count; j++) {
circle(bgr_frame, Point2f(p_face[i].points_array[j].x,
- p_face[i].points_array[j].y), 1, Scalar(0, 255, 0));
+ p_face[i].points_array[j].y), 1, Scalar(0, 255, 0));
}
}
--
Gitblit v1.8.0