mirror of
https://gitcode.com/gh_mirrors/ope/OpenFace.git
synced 2025-12-30 13:02:30 +00:00
Fixing compilation issues for gcc.
This commit is contained in:
@@ -130,17 +130,17 @@ int main(int argc, char **argv)
|
||||
|
||||
INFO_STREAM("Device or file opened");
|
||||
|
||||
cv::Mat captured_image = sequence_reader.GetNextFrame();
|
||||
cv::Mat rgb_image = sequence_reader.GetNextFrame();
|
||||
|
||||
INFO_STREAM("Starting tracking");
|
||||
while (!captured_image.empty()) // this is not a for loop as we might also be reading from a webcam
|
||||
while (!rgb_image.empty()) // this is not a for loop as we might also be reading from a webcam
|
||||
{
|
||||
|
||||
// Reading the images
|
||||
cv::Mat_<uchar> grayscale_image = sequence_reader.GetGrayFrame();
|
||||
|
||||
// The actual facial landmark detection / tracking
|
||||
bool detection_success = LandmarkDetector::DetectLandmarksInVideo(grayscale_image, face_model, det_parameters);
|
||||
bool detection_success = LandmarkDetector::DetectLandmarksInVideo(rgb_image, face_model, det_parameters, grayscale_image);
|
||||
|
||||
// Gaze tracking, absolute gaze direction
|
||||
cv::Point3f gazeDirection0(0, 0, -1);
|
||||
@@ -160,7 +160,7 @@ int main(int argc, char **argv)
|
||||
fps_tracker.AddFrame();
|
||||
|
||||
// Displaying the tracking visualizations
|
||||
visualizer.SetImage(captured_image, sequence_reader.fx, sequence_reader.fy, sequence_reader.cx, sequence_reader.cy);
|
||||
visualizer.SetImage(rgb_image, sequence_reader.fx, sequence_reader.fy, sequence_reader.cx, sequence_reader.cy);
|
||||
visualizer.SetObservationLandmarks(face_model.detected_landmarks, face_model.detection_certainty, face_model.GetVisibilities());
|
||||
visualizer.SetObservationPose(pose_estimate, face_model.detection_certainty);
|
||||
visualizer.SetObservationGaze(gazeDirection0, gazeDirection1, LandmarkDetector::CalculateAllEyeLandmarks(face_model), LandmarkDetector::Calculate3DEyeLandmarks(face_model, sequence_reader.fx, sequence_reader.fy, sequence_reader.cx, sequence_reader.cy), face_model.detection_certainty);
|
||||
@@ -180,7 +180,7 @@ int main(int argc, char **argv)
|
||||
}
|
||||
|
||||
// Grabbing the next frame in the sequence
|
||||
captured_image = sequence_reader.GetNextFrame();
|
||||
rgb_image = sequence_reader.GetNextFrame();
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -303,7 +303,7 @@ int main(int argc, char **argv)
|
||||
else
|
||||
{
|
||||
// The actual facial landmark detection / tracking
|
||||
detection_success = LandmarkDetector::DetectLandmarksInVideo(grayscale_image, face_models[model], det_parameters[model]);
|
||||
detection_success = LandmarkDetector::DetectLandmarksInVideo(rgb_image, face_models[model], det_parameters[model], grayscale_image);
|
||||
}
|
||||
}
|
||||
//});
|
||||
|
||||
@@ -55,17 +55,17 @@ namespace LandmarkDetector
|
||||
// Optionally can provide a bounding box from which to start tracking
|
||||
// Can also optionally pass a grayscale image if it has already been computed to speed things up a bit
|
||||
//================================================================================================================
|
||||
bool DetectLandmarksInVideo(const cv::Mat &rgb_image, CLNF& clnf_model, FaceModelParameters& params, cv::Mat &grayscale_image = cv::Mat());
|
||||
bool DetectLandmarksInVideo(const cv::Mat &rgb_image, const cv::Rect_<double> bounding_box, CLNF& clnf_model, FaceModelParameters& params, cv::Mat &grayscale_image = cv::Mat());
|
||||
bool DetectLandmarksInVideo(const cv::Mat &rgb_image, CLNF& clnf_model, FaceModelParameters& params, cv::Mat &grayscale_image);
|
||||
bool DetectLandmarksInVideo(const cv::Mat &rgb_image, const cv::Rect_<double> bounding_box, CLNF& clnf_model, FaceModelParameters& params, cv::Mat &grayscale_image);
|
||||
|
||||
//================================================================================================================
|
||||
// Landmark detection in image, need to provide an image and optionally CLNF model together with parameters (default values work well)
|
||||
// Optionally can provide a bounding box in which detection is performed (this is useful if multiple faces are to be detected in images)
|
||||
// Can also optionally pass a grayscale image if it has already been computed to speed things up a bit
|
||||
//================================================================================================================
|
||||
bool DetectLandmarksInImage(const cv::Mat &rgb_image, CLNF& clnf_model, FaceModelParameters& params, cv::Mat &grayscale_image = cv::Mat());
|
||||
bool DetectLandmarksInImage(const cv::Mat &rgb_image, CLNF& clnf_model, FaceModelParameters& params, cv::Mat &grayscale_image);
|
||||
// Providing a bounding box
|
||||
bool DetectLandmarksInImage(const cv::Mat &rgb_image, const cv::Rect_<double> bounding_box, CLNF& clnf_model, FaceModelParameters& params, cv::Mat &grayscale_image = cv::Mat());
|
||||
bool DetectLandmarksInImage(const cv::Mat &rgb_image, const cv::Rect_<double> bounding_box, CLNF& clnf_model, FaceModelParameters& params, cv::Mat &grayscale_image);
|
||||
|
||||
//================================================================
|
||||
// Helper function for getting head pose from CLNF parameters
|
||||
|
||||
Reference in New Issue
Block a user