icub-client
|
Face tracking module for iCub head and gaze using OpenCV functions Version:1.0. More...
Classes | |
class | faceTrackerModule |
Face tracking module for iCub head and gaze using OpenCV functions Version:1.0.
Using the face detection functions of OpenCV, the iCub is detecting faces every frame. Then, it tries to follow the located face in the middle of the view by moving the head and eyes simultaneously. Only the images of the left eye are used for tracking (not both eyes). There are several modes which are internally used for the tracking: 'set position mode', 'face tracking mode, and 'face searching mode'.
class faceTrackerModule |
Definition at line 38 of file faceTracker.h.
Public Member Functions | |
bool | configure (yarp::os::ResourceFinder &rf) |
configure all the module parameters and return true if successful More... | |
bool | interruptModule () |
interrupt the ports More... | |
bool | close () |
close and shut down the module More... | |
bool | respond (const yarp::os::Bottle &command, yarp::os::Bottle &reply) |
double | getPeriod () |
bool | updateModule () |
get an image from the robot's camera and decide which mode should be chosen next More... | |
Protected Types | |
enum | Mode { Mode::GO_DEFAULT, Mode::FACE_SEARCHING, Mode::FACE_TRACKING, Mode::PAUSED } |
Protected Member Functions | |
void | moveToDefaultPosition () |
Move to center position (after being stuck) More... | |
void | faceSearching (bool face_found) |
Randomly move around. More... | |
void | faceTracking (const std::vector< cv::Rect > &faces_left, int biggest_face_left_idx) |
If a face was found, track it. More... | |
Protected Attributes | |
double | x_buf |
double | y_buf |
Mode | mode |
int | counter_no_face_found |
if in face tracking mode, for how many iterations was no face found More... | |
int | setpos_counter |
how many iterations have we spend in default position mode More... | |
int | panning_counter |
how many times have we spend in face searching mode. More... | |
int | stuck_counter |
int | tilt_target |
tilt target for face search mode (randomly chosen) More... | |
int | pan_target |
pan target for face search mode (randomly chosen) More... | |
int | pan_max |
maximum pan for the iCub More... | |
int | tilt_max |
maximum tilt for the iCub More... | |
int | nr_jnts |
number of joints of the iCub head More... | |
cv::CascadeClassifier | face_classifier_left |
IplImage * | cvIplImageLeft |
|
strongprotected |
Enumerator | |
---|---|
GO_DEFAULT | |
FACE_SEARCHING | |
FACE_TRACKING | |
PAUSED |
Definition at line 58 of file faceTracker.h.
bool faceTrackerModule::close | ( | ) |
close and shut down the module
Definition at line 137 of file faceTracker.cpp.
bool faceTrackerModule::configure | ( | yarp::os::ResourceFinder & | rf | ) |
configure all the module parameters and return true if successful
Definition at line 29 of file faceTracker.cpp.
|
protected |
Randomly move around.
Definition at line 207 of file faceTracker.cpp.
|
protected |
If a face was found, track it.
Definition at line 235 of file faceTracker.cpp.
double faceTrackerModule::getPeriod | ( | ) |
Definition at line 175 of file faceTracker.cpp.
bool faceTrackerModule::interruptModule | ( | ) |
interrupt the ports
Definition at line 130 of file faceTracker.cpp.
|
protected |
Move to center position (after being stuck)
Definition at line 179 of file faceTracker.cpp.
bool faceTrackerModule::respond | ( | const yarp::os::Bottle & | command, |
yarp::os::Bottle & | reply | ||
) |
Definition at line 149 of file faceTracker.cpp.
bool faceTrackerModule::updateModule | ( | ) |
get an image from the robot's camera and decide which mode should be chosen next
Definition at line 340 of file faceTracker.cpp.
|
protected |
if in face tracking mode, for how many iterations was no face found
Definition at line 60 of file faceTracker.h.
|
protected |
Definition at line 73 of file faceTracker.h.
|
protected |
Definition at line 72 of file faceTracker.h.
|
protected |
Definition at line 59 of file faceTracker.h.
|
protected |
number of joints of the iCub head
Definition at line 70 of file faceTracker.h.
|
protected |
maximum pan for the iCub
Definition at line 68 of file faceTracker.h.
|
protected |
pan target for face search mode (randomly chosen)
Definition at line 67 of file faceTracker.h.
|
protected |
how many times have we spend in face searching mode.
If >5, go back to default position
Definition at line 62 of file faceTracker.h.
|
protected |
how many iterations have we spend in default position mode
Definition at line 61 of file faceTracker.h.
|
protected |
Definition at line 63 of file faceTracker.h.
|
protected |
maximum tilt for the iCub
Definition at line 69 of file faceTracker.h.
|
protected |
tilt target for face search mode (randomly chosen)
Definition at line 66 of file faceTracker.h.
|
protected |
Definition at line 55 of file faceTracker.h.
|
protected |
Definition at line 56 of file faceTracker.h.