From 9c2e5d6cbad283b230062717d84dfca5dc1d6aff Mon Sep 17 00:00:00 2001 From: Yudong Tao Date: Fri, 5 Oct 2018 11:53:06 -0400 Subject: [PATCH] Update the OpenCV constants to the corresponding ones in cpp namespace. (#578) Updating OpenCV macros. --- .github/ISSUE_TEMPLATE/bug_report.md | 25 +++++++++++++++ lib/local/FaceAnalyser/src/FaceAnalyser.cpp | 10 +++--- .../src/CCNF_patch_expert.cpp | 12 +++---- .../src/LandmarkDetectorFunc.cpp | 10 +++--- .../src/LandmarkDetectorModel.cpp | 2 +- .../src/LandmarkDetectorUtils.cpp | 29 ++++++++--------- lib/local/LandmarkDetector/src/PAW.cpp | 12 +++---- lib/local/LandmarkDetector/src/PDM.cpp | 10 +++--- .../LandmarkDetector/src/Patch_experts.cpp | 12 +++---- .../LandmarkDetector/src/SVR_patch_expert.cpp | 12 +++---- lib/local/Utilities/src/ImageCapture.cpp | 12 +++---- lib/local/Utilities/src/RecorderOpenFace.cpp | 10 +++--- lib/local/Utilities/src/SequenceCapture.cpp | 32 +++++++++---------- lib/local/Utilities/src/Visualizer.cpp | 10 +++--- 14 files changed, 111 insertions(+), 87 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 00000000..ef144a9a --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,25 @@ +--- +name: Bug report +about: Create a report to help us improve + +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior, with error description (and images/videos if failing on them). + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots** +If applicable, add screenshots to help explain your problem. + +**Desktop (please complete the following information):** + - OS: [e.g. iOS] + - Version [e.g. 22] + - Compiler [if compilation or linker error] + +**Additional context** +Add any other context about the problem here. diff --git a/lib/local/FaceAnalyser/src/FaceAnalyser.cpp b/lib/local/FaceAnalyser/src/FaceAnalyser.cpp index ba7bf13f..8fa93d9b 100644 --- a/lib/local/FaceAnalyser/src/FaceAnalyser.cpp +++ b/lib/local/FaceAnalyser/src/FaceAnalyser.cpp @@ -14,19 +14,19 @@ // reports and manuals, must cite at least one of the following works: // // OpenFace 2.0: Facial Behavior Analysis Toolkit -// Tadas Baltrušaitis, Amir Zadeh, Yao Chong Lim, and Louis-Philippe Morency +// Tadas Baltrušaitis, Amir Zadeh, Yao Chong Lim, and Louis-Philippe Morency // in IEEE International Conference on Automatic Face and Gesture Recognition, 2018 // // Convolutional experts constrained local model for facial landmark detection. -// A. Zadeh, T. Baltrušaitis, and Louis-Philippe Morency, +// A. Zadeh, T. Baltrušaitis, and Louis-Philippe Morency, // in Computer Vision and Pattern Recognition Workshops, 2017. // // Rendering of Eyes for Eye-Shape Registration and Gaze Estimation -// Erroll Wood, Tadas Baltrušaitis, Xucong Zhang, Yusuke Sugano, Peter Robinson, and Andreas Bulling +// Erroll Wood, Tadas Baltrušaitis, Xucong Zhang, Yusuke Sugano, Peter Robinson, and Andreas Bulling // in IEEE International. Conference on Computer Vision (ICCV), 2015 // // Cross-dataset learning and person-specific normalisation for automatic Action Unit detection -// Tadas Baltrušaitis, Marwa Mahmoud, and Peter Robinson +// Tadas Baltrušaitis, Marwa Mahmoud, and Peter Robinson // in Facial Expression Recognition and Analysis Challenge, // IEEE International Conference on Automatic Face and Gesture Recognition, 2015 // @@ -370,7 +370,7 @@ void FaceAnalyser::AddNextFrame(const cv::Mat& frame, const cv::Mat_& det if (aligned_face_for_output.channels() == 3 && out_grayscale) { - cvtColor(aligned_face_for_output, aligned_face_for_output, CV_BGR2GRAY); + cvtColor(aligned_face_for_output, aligned_face_for_output, cv::COLOR_BGR2GRAY); } // Extract HOG descriptor from the frame and convert it to a useable format diff --git a/lib/local/LandmarkDetector/src/CCNF_patch_expert.cpp b/lib/local/LandmarkDetector/src/CCNF_patch_expert.cpp index bff3aa73..e332bf1b 100644 --- a/lib/local/LandmarkDetector/src/CCNF_patch_expert.cpp +++ b/lib/local/LandmarkDetector/src/CCNF_patch_expert.cpp @@ -14,19 +14,19 @@ // reports and manuals, must cite at least one of the following works: // // OpenFace 2.0: Facial Behavior Analysis Toolkit -// Tadas Baltrušaitis, Amir Zadeh, Yao Chong Lim, and Louis-Philippe Morency +// Tadas Baltrušaitis, Amir Zadeh, Yao Chong Lim, and Louis-Philippe Morency // in IEEE International Conference on Automatic Face and Gesture Recognition, 2018 // // Convolutional experts constrained local model for facial landmark detection. -// A. Zadeh, T. Baltrušaitis, and Louis-Philippe Morency, +// A. Zadeh, T. Baltrušaitis, and Louis-Philippe Morency, // in Computer Vision and Pattern Recognition Workshops, 2017. // // Rendering of Eyes for Eye-Shape Registration and Gaze Estimation -// Erroll Wood, Tadas Baltrušaitis, Xucong Zhang, Yusuke Sugano, Peter Robinson, and Andreas Bulling +// Erroll Wood, Tadas Baltrušaitis, Xucong Zhang, Yusuke Sugano, Peter Robinson, and Andreas Bulling // in IEEE International. Conference on Computer Vision (ICCV), 2015 // // Cross-dataset learning and person-specific normalisation for automatic Action Unit detection -// Tadas Baltrušaitis, Marwa Mahmoud, and Peter Robinson +// Tadas Baltrušaitis, Marwa Mahmoud, and Peter Robinson // in Facial Expression Recognition and Analysis Challenge, // IEEE International Conference on Automatic Face and Gesture Recognition, 2015 // @@ -264,11 +264,11 @@ void CCNF_neuron::Response(const cv::Mat_ &im, cv::Mat_ &im_dft, if(neuron_type == 3) { // In case of depth we use per area, rather than per patch normalisation - matchTemplate_m(I, im_dft, integral_img, integral_img_sq, weights, weights_dfts, resp, CV_TM_CCOEFF); // the linear multiplication, efficient calc of response + matchTemplate_m(I, im_dft, integral_img, integral_img_sq, weights, weights_dfts, resp, cv::TM_CCOEFF); // the linear multiplication, efficient calc of response } else { - matchTemplate_m(I, im_dft, integral_img, integral_img_sq, weights, weights_dfts, resp, CV_TM_CCOEFF_NORMED); // the linear multiplication, efficient calc of response + matchTemplate_m(I, im_dft, integral_img, integral_img_sq, weights, weights_dfts, resp, cv::TM_CCOEFF_NORMED); // the linear multiplication, efficient calc of response } cv::MatIterator_ p = resp.begin(); diff --git a/lib/local/LandmarkDetector/src/LandmarkDetectorFunc.cpp b/lib/local/LandmarkDetector/src/LandmarkDetectorFunc.cpp index 16b7d9ad..281fd735 100644 --- a/lib/local/LandmarkDetector/src/LandmarkDetectorFunc.cpp +++ b/lib/local/LandmarkDetector/src/LandmarkDetectorFunc.cpp @@ -14,19 +14,19 @@ // reports and manuals, must cite at least one of the following works: // // OpenFace 2.0: Facial Behavior Analysis Toolkit -// Tadas Baltrušaitis, Amir Zadeh, Yao Chong Lim, and Louis-Philippe Morency +// Tadas Baltrušaitis, Amir Zadeh, Yao Chong Lim, and Louis-Philippe Morency // in IEEE International Conference on Automatic Face and Gesture Recognition, 2018 // // Convolutional experts constrained local model for facial landmark detection. -// A. Zadeh, T. Baltrušaitis, and Louis-Philippe Morency, +// A. Zadeh, T. Baltrušaitis, and Louis-Philippe Morency, // in Computer Vision and Pattern Recognition Workshops, 2017. // // Rendering of Eyes for Eye-Shape Registration and Gaze Estimation -// Erroll Wood, Tadas Baltrušaitis, Xucong Zhang, Yusuke Sugano, Peter Robinson, and Andreas Bulling +// Erroll Wood, Tadas Baltrušaitis, Xucong Zhang, Yusuke Sugano, Peter Robinson, and Andreas Bulling // in IEEE International. Conference on Computer Vision (ICCV), 2015 // // Cross-dataset learning and person-specific normalisation for automatic Action Unit detection -// Tadas Baltrušaitis, Marwa Mahmoud, and Peter Robinson +// Tadas Baltrušaitis, Marwa Mahmoud, and Peter Robinson // in Facial Expression Recognition and Analysis Challenge, // IEEE International Conference on Automatic Face and Gesture Recognition, 2015 // @@ -194,7 +194,7 @@ void CorrectGlobalParametersVideo(const cv::Mat_ &grayscale_image, CLNF& // Resizing the template cv::Mat corr_out; - cv::matchTemplate(image, clnf_model.face_template, corr_out, CV_TM_CCOEFF_NORMED); + cv::matchTemplate(image, clnf_model.face_template, corr_out, cv::TM_CCOEFF_NORMED); // Actually matching it //double min, max; diff --git a/lib/local/LandmarkDetector/src/LandmarkDetectorModel.cpp b/lib/local/LandmarkDetector/src/LandmarkDetectorModel.cpp index 9861af99..136fd591 100644 --- a/lib/local/LandmarkDetector/src/LandmarkDetectorModel.cpp +++ b/lib/local/LandmarkDetector/src/LandmarkDetectorModel.cpp @@ -1128,7 +1128,7 @@ float CLNF::NU_RLMS(cv::Vec6f& final_global, cv::Mat_& final_local, const // Solve for the parameter update (from Baltrusaitis 2013 based on eq (36) Saragih 2011) cv::Mat_ param_update; - cv::solve(Hessian, J_w_t_m, param_update, CV_CHOLESKY); + cv::solve(Hessian, J_w_t_m, param_update, cv::DECOMP_CHOLESKY); // update the reference pdm.UpdateModelParameters(param_update, current_local, current_global); diff --git a/lib/local/LandmarkDetector/src/LandmarkDetectorUtils.cpp b/lib/local/LandmarkDetector/src/LandmarkDetectorUtils.cpp index 3b4be670..887c6e53 100644 --- a/lib/local/LandmarkDetector/src/LandmarkDetectorUtils.cpp +++ b/lib/local/LandmarkDetector/src/LandmarkDetectorUtils.cpp @@ -14,19 +14,19 @@ // reports and manuals, must cite at least one of the following works: // // OpenFace 2.0: Facial Behavior Analysis Toolkit -// Tadas Baltrušaitis, Amir Zadeh, Yao Chong Lim, and Louis-Philippe Morency +// Tadas Baltrušaitis, Amir Zadeh, Yao Chong Lim, and Louis-Philippe Morency // in IEEE International Conference on Automatic Face and Gesture Recognition, 2018 // // Convolutional experts constrained local model for facial landmark detection. -// A. Zadeh, T. Baltrušaitis, and Louis-Philippe Morency, +// A. Zadeh, T. Baltrušaitis, and Louis-Philippe Morency, // in Computer Vision and Pattern Recognition Workshops, 2017. // // Rendering of Eyes for Eye-Shape Registration and Gaze Estimation -// Erroll Wood, Tadas Baltrušaitis, Xucong Zhang, Yusuke Sugano, Peter Robinson, and Andreas Bulling +// Erroll Wood, Tadas Baltrušaitis, Xucong Zhang, Yusuke Sugano, Peter Robinson, and Andreas Bulling // in IEEE International. Conference on Computer Vision (ICCV), 2015 // // Cross-dataset learning and person-specific normalisation for automatic Action Unit detection -// Tadas Baltrušaitis, Marwa Mahmoud, and Peter Robinson +// Tadas Baltrušaitis, Marwa Mahmoud, and Peter Robinson // in Facial Expression Recognition and Analysis Challenge, // IEEE International Conference on Automatic Face and Gesture Recognition, 2015 // @@ -150,11 +150,11 @@ namespace LandmarkDetector void matchTemplate_m(const cv::Mat_& input_img, cv::Mat_& img_dft, cv::Mat& _integral_img, cv::Mat& _integral_img_sq, const cv::Mat_& templ, map >& templ_dfts, cv::Mat_& result, int method) { - int numType = method == CV_TM_CCORR || method == CV_TM_CCORR_NORMED ? 0 : - method == CV_TM_CCOEFF || method == CV_TM_CCOEFF_NORMED ? 1 : 2; - bool isNormed = method == CV_TM_CCORR_NORMED || - method == CV_TM_SQDIFF_NORMED || - method == CV_TM_CCOEFF_NORMED; + int numType = method == cv::TM_CCORR || method == cv::TM_CCORR_NORMED ? 0 : + method == cv::TM_CCOEFF || method == cv::TM_CCOEFF_NORMED ? 1 : 2; + bool isNormed = method == cv::TM_CCORR_NORMED || + method == cv::TM_SQDIFF_NORMED || + method == cv::TM_CCOEFF_NORMED; // Assume result is defined properly if (result.empty()) @@ -164,7 +164,7 @@ namespace LandmarkDetector } LandmarkDetector::crossCorr_m(input_img, img_dft, templ, templ_dfts, result); - if (method == CV_TM_CCORR) + if (method == cv::TM_CCORR) return; double invArea = 1. / ((double)templ.rows * templ.cols); @@ -174,7 +174,7 @@ namespace LandmarkDetector double *q0 = 0, *q1 = 0, *q2 = 0, *q3 = 0; double templNorm = 0, templSum2 = 0; - if (method == CV_TM_CCOEFF) + if (method == cv::TM_CCOEFF) { // If it has not been precomputed compute it now if (_integral_img.empty()) @@ -200,7 +200,7 @@ namespace LandmarkDetector templNorm = templSdv[0] * templSdv[0] + templSdv[1] * templSdv[1] + templSdv[2] * templSdv[2] + templSdv[3] * templSdv[3]; - if (templNorm < DBL_EPSILON && method == CV_TM_CCOEFF_NORMED) + if (templNorm < DBL_EPSILON && method == cv::TM_CCOEFF_NORMED) { result.setTo(1.0); return; @@ -276,7 +276,7 @@ namespace LandmarkDetector else if (fabs(num) < t*1.125) num = num > 0 ? 1 : -1; else - num = method != CV_TM_SQDIFF_NORMED ? 0 : 1; + num = method != cv::TM_SQDIFF_NORMED ? 0 : 1; } rrow[j] = (float)num; @@ -543,8 +543,7 @@ namespace LandmarkDetector if (min_width != -1) { - if (region.width < min_width || region.x < ((float)intensity.cols) * roi.x || region.y < ((float)intensity.cols) * roi.y || - region.x + region.width >((float)intensity.cols) * (roi.x + roi.width) || region.y + region.height >((float)intensity.rows) * (roi.y + roi.height)) + if (region.width < min_width || region.x < ((float)intensity.cols) * roi.x || region.y < ((float)intensity.cols) * roi.y || region.x + region.width >((float)intensity.cols) * (roi.x + roi.width) || region.y + region.height >((float)intensity.rows) * (roi.y + roi.height)) continue; } diff --git a/lib/local/LandmarkDetector/src/PAW.cpp b/lib/local/LandmarkDetector/src/PAW.cpp index 13eb723d..974184b3 100644 --- a/lib/local/LandmarkDetector/src/PAW.cpp +++ b/lib/local/LandmarkDetector/src/PAW.cpp @@ -14,19 +14,19 @@ // reports and manuals, must cite at least one of the following works: // // OpenFace 2.0: Facial Behavior Analysis Toolkit -// Tadas Baltrušaitis, Amir Zadeh, Yao Chong Lim, and Louis-Philippe Morency +// Tadas Baltrušaitis, Amir Zadeh, Yao Chong Lim, and Louis-Philippe Morency // in IEEE International Conference on Automatic Face and Gesture Recognition, 2018 // // Convolutional experts constrained local model for facial landmark detection. -// A. Zadeh, T. Baltrušaitis, and Louis-Philippe Morency, +// A. Zadeh, T. Baltrušaitis, and Louis-Philippe Morency, // in Computer Vision and Pattern Recognition Workshops, 2017. // // Rendering of Eyes for Eye-Shape Registration and Gaze Estimation -// Erroll Wood, Tadas Baltrušaitis, Xucong Zhang, Yusuke Sugano, Peter Robinson, and Andreas Bulling +// Erroll Wood, Tadas Baltrušaitis, Xucong Zhang, Yusuke Sugano, Peter Robinson, and Andreas Bulling // in IEEE International. Conference on Computer Vision (ICCV), 2015 // // Cross-dataset learning and person-specific normalisation for automatic Action Unit detection -// Tadas Baltrušaitis, Marwa Mahmoud, and Peter Robinson +// Tadas Baltrušaitis, Marwa Mahmoud, and Peter Robinson // in Facial Expression Recognition and Analysis Challenge, // IEEE International Conference on Automatic Face and Gesture Recognition, 2015 // @@ -328,7 +328,7 @@ void PAW::Warp(const cv::Mat& image_to_warp, cv::Mat& destination_image, const c this->WarpRegion(map_x, map_y); // Do the actual warp (with bi-linear interpolation) - remap(image_to_warp, destination_image, map_x, map_y, CV_INTER_LINEAR); + remap(image_to_warp, destination_image, map_x, map_y, cv::INTER_LINEAR); } @@ -512,4 +512,4 @@ int PAW::findTriangle(const cv::Point_& point, const std::vector& out_params_l // Solve for the parameter update (from Baltrusaitis 2013 based on eq (36) Saragih 2011) cv::Mat_ param_update; - cv::solve(Hessian, J_w_t_m, param_update, CV_CHOLESKY); + cv::solve(Hessian, J_w_t_m, param_update, cv::DECOMP_CHOLESKY); // To not overshoot, have the gradient decent rate a bit smaller param_update = 0.75 * param_update; diff --git a/lib/local/LandmarkDetector/src/Patch_experts.cpp b/lib/local/LandmarkDetector/src/Patch_experts.cpp index 5f29f538..9ceb3c75 100644 --- a/lib/local/LandmarkDetector/src/Patch_experts.cpp +++ b/lib/local/LandmarkDetector/src/Patch_experts.cpp @@ -14,19 +14,19 @@ // reports and manuals, must cite at least one of the following works: // // OpenFace 2.0: Facial Behavior Analysis Toolkit -// Tadas Baltrušaitis, Amir Zadeh, Yao Chong Lim, and Louis-Philippe Morency +// Tadas Baltrušaitis, Amir Zadeh, Yao Chong Lim, and Louis-Philippe Morency // in IEEE International Conference on Automatic Face and Gesture Recognition, 2018 // // Convolutional experts constrained local model for facial landmark detection. -// A. Zadeh, T. Baltrušaitis, and Louis-Philippe Morency, +// A. Zadeh, T. Baltrušaitis, and Louis-Philippe Morency, // in Computer Vision and Pattern Recognition Workshops, 2017. // // Rendering of Eyes for Eye-Shape Registration and Gaze Estimation -// Erroll Wood, Tadas Baltrušaitis, Xucong Zhang, Yusuke Sugano, Peter Robinson, and Andreas Bulling +// Erroll Wood, Tadas Baltrušaitis, Xucong Zhang, Yusuke Sugano, Peter Robinson, and Andreas Bulling // in IEEE International. Conference on Computer Vision (ICCV), 2015 // // Cross-dataset learning and person-specific normalisation for automatic Action Unit detection -// Tadas Baltrušaitis, Marwa Mahmoud, and Peter Robinson +// Tadas Baltrušaitis, Marwa Mahmoud, and Peter Robinson // in Facial Expression Recognition and Analysis Challenge, // IEEE International Conference on Automatic Face and Gesture Recognition, 2015 // @@ -248,7 +248,7 @@ void Patch_experts::Response(vector >& patch_expert_responses, c // Extract the region of interest around the current landmark location cv::Mat_ area_of_interest(area_of_interest_height, area_of_interest_width, 0.0f); - cv::warpAffine(grayscale_image, area_of_interest, sim, area_of_interest.size(), cv::WARP_INVERSE_MAP + CV_INTER_LINEAR); + cv::warpAffine(grayscale_image, area_of_interest, sim, area_of_interest.size(), cv::WARP_INVERSE_MAP + cv::INTER_LINEAR); // Get intensity response either from the SVR, CCNF, or CEN patch experts (prefer CEN as they are the most accurate so far) if (!cen_expert_intensity.empty()) @@ -282,7 +282,7 @@ void Patch_experts::Response(vector >& patch_expert_responses, c // Extract the region of interest around the current landmark location cv::Mat_ area_of_interest_r(area_of_interest_height, area_of_interest_width, 0.0f); - cv::warpAffine(grayscale_image, area_of_interest_r, sim_r, area_of_interest_r.size(), cv::WARP_INVERSE_MAP + CV_INTER_LINEAR); + cv::warpAffine(grayscale_image, area_of_interest_r, sim_r, area_of_interest_r.size(), cv::WARP_INVERSE_MAP + cv::INTER_LINEAR); cv::Mat_ prealloc_mat_right = preallocated_im2col[mirror_id][im2col_size]; diff --git a/lib/local/LandmarkDetector/src/SVR_patch_expert.cpp b/lib/local/LandmarkDetector/src/SVR_patch_expert.cpp index ace3317d..60644d45 100644 --- a/lib/local/LandmarkDetector/src/SVR_patch_expert.cpp +++ b/lib/local/LandmarkDetector/src/SVR_patch_expert.cpp @@ -14,19 +14,19 @@ // reports and manuals, must cite at least one of the following works: // // OpenFace 2.0: Facial Behavior Analysis Toolkit -// Tadas Baltrušaitis, Amir Zadeh, Yao Chong Lim, and Louis-Philippe Morency +// Tadas Baltrušaitis, Amir Zadeh, Yao Chong Lim, and Louis-Philippe Morency // in IEEE International Conference on Automatic Face and Gesture Recognition, 2018 // // Convolutional experts constrained local model for facial landmark detection. -// A. Zadeh, T. Baltrušaitis, and Louis-Philippe Morency, +// A. Zadeh, T. Baltrušaitis, and Louis-Philippe Morency, // in Computer Vision and Pattern Recognition Workshops, 2017. // // Rendering of Eyes for Eye-Shape Registration and Gaze Estimation -// Erroll Wood, Tadas Baltrušaitis, Xucong Zhang, Yusuke Sugano, Peter Robinson, and Andreas Bulling +// Erroll Wood, Tadas Baltrušaitis, Xucong Zhang, Yusuke Sugano, Peter Robinson, and Andreas Bulling // in IEEE International. Conference on Computer Vision (ICCV), 2015 // // Cross-dataset learning and person-specific normalisation for automatic Action Unit detection -// Tadas Baltrušaitis, Marwa Mahmoud, and Peter Robinson +// Tadas Baltrušaitis, Marwa Mahmoud, and Peter Robinson // in Facial Expression Recognition and Analysis Challenge, // IEEE International Conference on Automatic Face and Gesture Recognition, 2015 // @@ -179,7 +179,7 @@ void SVR_patch_expert::Response(const cv::Mat_& area_of_interest, cv::Mat cv::Mat_ empty_matrix_2(0,0,0.0); // Efficient calc of patch expert SVR response across the area of interest - matchTemplate_m(normalised_area_of_interest, empty_matrix_0, empty_matrix_1, empty_matrix_2, weights, weights_dfts, svr_response, CV_TM_CCOEFF_NORMED); + matchTemplate_m(normalised_area_of_interest, empty_matrix_0, empty_matrix_1, empty_matrix_2, weights, weights_dfts, svr_response, cv::TM_CCOEFF_NORMED); response.create(svr_response.size()); cv::MatIterator_ p = response.begin(); @@ -246,7 +246,7 @@ void SVR_patch_expert::ResponseDepth(const cv::Mat_& area_of_interest, cv // Efficient calc of patch expert response across the area of interest - matchTemplate_m(normalised_area_of_interest, empty_matrix_0, empty_matrix_1, empty_matrix_2, weights, weights_dfts, svr_response, CV_TM_CCOEFF); + matchTemplate_m(normalised_area_of_interest, empty_matrix_0, empty_matrix_1, empty_matrix_2, weights, weights_dfts, svr_response, cv::TM_CCOEFF); response.create(svr_response.size()); cv::MatIterator_ p = response.begin(); diff --git a/lib/local/Utilities/src/ImageCapture.cpp b/lib/local/Utilities/src/ImageCapture.cpp index 25834587..2731fa01 100644 --- a/lib/local/Utilities/src/ImageCapture.cpp +++ b/lib/local/Utilities/src/ImageCapture.cpp @@ -13,19 +13,19 @@ // reports and manuals, must cite at least one of the following works: // // OpenFace 2.0: Facial Behavior Analysis Toolkit -// Tadas Baltrušaitis, Amir Zadeh, Yao Chong Lim, and Louis-Philippe Morency +// Tadas Baltrušaitis, Amir Zadeh, Yao Chong Lim, and Louis-Philippe Morency // in IEEE International Conference on Automatic Face and Gesture Recognition, 2018 // // Convolutional experts constrained local model for facial landmark detection. -// A. Zadeh, T. Baltrušaitis, and Louis-Philippe Morency, +// A. Zadeh, T. Baltrušaitis, and Louis-Philippe Morency, // in Computer Vision and Pattern Recognition Workshops, 2017. // // Rendering of Eyes for Eye-Shape Registration and Gaze Estimation -// Erroll Wood, Tadas Baltrušaitis, Xucong Zhang, Yusuke Sugano, Peter Robinson, and Andreas Bulling +// Erroll Wood, Tadas Baltrušaitis, Xucong Zhang, Yusuke Sugano, Peter Robinson, and Andreas Bulling // in IEEE International. Conference on Computer Vision (ICCV), 2015 // // Cross-dataset learning and person-specific normalisation for automatic Action Unit detection -// Tadas Baltrušaitis, Marwa Mahmoud, and Peter Robinson +// Tadas Baltrušaitis, Marwa Mahmoud, and Peter Robinson // in Facial Expression Recognition and Analysis Challenge, // IEEE International Conference on Automatic Face and Gesture Recognition, 2015 // @@ -358,7 +358,7 @@ cv::Mat ImageCapture::GetNextImage() } // Load the image as an 8 bit RGB - latest_frame = cv::imread(image_files[frame_num], CV_LOAD_IMAGE_COLOR); + latest_frame = cv::imread(image_files[frame_num], cv::IMREAD_COLOR); if (latest_frame.empty()) { @@ -420,4 +420,4 @@ double ImageCapture::GetProgress() cv::Mat_ ImageCapture::GetGrayFrame() { return latest_gray_frame; -} \ No newline at end of file +} diff --git a/lib/local/Utilities/src/RecorderOpenFace.cpp b/lib/local/Utilities/src/RecorderOpenFace.cpp index 74b36706..132bcf33 100644 --- a/lib/local/Utilities/src/RecorderOpenFace.cpp +++ b/lib/local/Utilities/src/RecorderOpenFace.cpp @@ -13,19 +13,19 @@ // reports and manuals, must cite at least one of the following works: // // OpenFace 2.0: Facial Behavior Analysis Toolkit -// Tadas Baltrušaitis, Amir Zadeh, Yao Chong Lim, and Louis-Philippe Morency +// Tadas Baltrušaitis, Amir Zadeh, Yao Chong Lim, and Louis-Philippe Morency // in IEEE International Conference on Automatic Face and Gesture Recognition, 2018 // // Convolutional experts constrained local model for facial landmark detection. -// A. Zadeh, T. Baltrušaitis, and Louis-Philippe Morency, +// A. Zadeh, T. Baltrušaitis, and Louis-Philippe Morency, // in Computer Vision and Pattern Recognition Workshops, 2017. // // Rendering of Eyes for Eye-Shape Registration and Gaze Estimation -// Erroll Wood, Tadas Baltrušaitis, Xucong Zhang, Yusuke Sugano, Peter Robinson, and Andreas Bulling +// Erroll Wood, Tadas Baltrušaitis, Xucong Zhang, Yusuke Sugano, Peter Robinson, and Andreas Bulling // in IEEE International. Conference on Computer Vision (ICCV), 2015 // // Cross-dataset learning and person-specific normalisation for automatic Action Unit detection -// Tadas Baltrušaitis, Marwa Mahmoud, and Peter Robinson +// Tadas Baltrušaitis, Marwa Mahmoud, and Peter Robinson // in Facial Expression Recognition and Analysis Challenge, // IEEE International Conference on Automatic Face and Gesture Recognition, 2015 // @@ -428,7 +428,7 @@ void RecorderOpenFace::WriteObservationTracked() std::string output_codec = params.outputCodec(); try { - video_writer.open(media_filename, CV_FOURCC(output_codec[0], output_codec[1], output_codec[2], output_codec[3]), params.outputFps(), vis_to_out.size(), true); + video_writer.open(media_filename, cv::VideoWriter::fourcc(output_codec[0], output_codec[1], output_codec[2], output_codec[3]), params.outputFps(), vis_to_out.size(), true); if (!video_writer.isOpened()) { diff --git a/lib/local/Utilities/src/SequenceCapture.cpp b/lib/local/Utilities/src/SequenceCapture.cpp index bdda81e0..46b2ffac 100644 --- a/lib/local/Utilities/src/SequenceCapture.cpp +++ b/lib/local/Utilities/src/SequenceCapture.cpp @@ -13,19 +13,19 @@ // reports and manuals, must cite at least one of the following works: // // OpenFace 2.0: Facial Behavior Analysis Toolkit -// Tadas Baltrušaitis, Amir Zadeh, Yao Chong Lim, and Louis-Philippe Morency +// Tadas Baltrušaitis, Amir Zadeh, Yao Chong Lim, and Louis-Philippe Morency // in IEEE International Conference on Automatic Face and Gesture Recognition, 2018 // // Convolutional experts constrained local model for facial landmark detection. -// A. Zadeh, T. Baltrušaitis, and Louis-Philippe Morency, +// A. Zadeh, T. Baltrušaitis, and Louis-Philippe Morency, // in Computer Vision and Pattern Recognition Workshops, 2017. // // Rendering of Eyes for Eye-Shape Registration and Gaze Estimation -// Erroll Wood, Tadas Baltrušaitis, Xucong Zhang, Yusuke Sugano, Peter Robinson, and Andreas Bulling +// Erroll Wood, Tadas Baltrušaitis, Xucong Zhang, Yusuke Sugano, Peter Robinson, and Andreas Bulling // in IEEE International. Conference on Computer Vision (ICCV), 2015 // // Cross-dataset learning and person-specific normalisation for automatic Action Unit detection -// Tadas Baltrušaitis, Marwa Mahmoud, and Peter Robinson +// Tadas Baltrušaitis, Marwa Mahmoud, and Peter Robinson // in Facial Expression Recognition and Analysis Challenge, // IEEE International Conference on Automatic Face and Gesture Recognition, 2015 // @@ -232,16 +232,16 @@ bool SequenceCapture::OpenWebcam(int device, int image_width, int image_height, latest_gray_frame = cv::Mat(); capture.open(device); - capture.set(CV_CAP_PROP_FRAME_WIDTH, image_width); - capture.set(CV_CAP_PROP_FRAME_HEIGHT, image_height); + capture.set(cv::CAP_PROP_FRAME_WIDTH, image_width); + capture.set(cv::CAP_PROP_FRAME_HEIGHT, image_height); is_webcam = true; is_image_seq = false; vid_length = 0; - this->frame_width = (int)capture.get(CV_CAP_PROP_FRAME_WIDTH); - this->frame_height = (int)capture.get(CV_CAP_PROP_FRAME_HEIGHT); + this->frame_width = (int)capture.get(cv::CAP_PROP_FRAME_WIDTH); + this->frame_height = (int)capture.get(cv::CAP_PROP_FRAME_HEIGHT); if (!capture.isOpened()) { @@ -254,7 +254,7 @@ bool SequenceCapture::OpenWebcam(int device, int image_width, int image_height, std::cout << "Defaulting to " << frame_width << "x" << frame_height << std::endl; } - this->fps = capture.get(CV_CAP_PROP_FPS); + this->fps = capture.get(cv::CAP_PROP_FPS); // Check if fps is nan or less than 0 if (fps != fps || fps <= 0) @@ -319,7 +319,7 @@ bool SequenceCapture::OpenVideoFile(std::string video_file, float fx, float fy, return false; } - this->fps = capture.get(CV_CAP_PROP_FPS); + this->fps = capture.get(cv::CAP_PROP_FPS); // Check if fps is nan or less than 0 if (fps != fps || fps <= 0) @@ -331,10 +331,10 @@ bool SequenceCapture::OpenVideoFile(std::string video_file, float fx, float fy, is_webcam = false; is_image_seq = false; - this->frame_width = (int)capture.get(CV_CAP_PROP_FRAME_WIDTH); - this->frame_height = (int)capture.get(CV_CAP_PROP_FRAME_HEIGHT); + this->frame_width = (int)capture.get(cv::CAP_PROP_FRAME_WIDTH); + this->frame_height = (int)capture.get(cv::CAP_PROP_FRAME_HEIGHT); - vid_length = (int)capture.get(CV_CAP_PROP_FRAME_COUNT); + vid_length = (int)capture.get(cv::CAP_PROP_FRAME_COUNT); SetCameraIntrinsics(fx, fy, cx, cy); @@ -390,7 +390,7 @@ bool SequenceCapture::OpenImageSequence(std::string directory, float fx, float f } // Assume all images are same size in an image sequence - cv::Mat tmp = cv::imread(image_files[0], CV_LOAD_IMAGE_COLOR); + cv::Mat tmp = cv::imread(image_files[0], cv::IMREAD_COLOR); this->frame_height = tmp.size().height; this->frame_width = tmp.size().width; @@ -476,7 +476,7 @@ void SequenceCapture::CaptureThread() } else { - tmp_frame = cv::imread(image_files[frame_num_int], CV_LOAD_IMAGE_COLOR); + tmp_frame = cv::imread(image_files[frame_num_int], cv::IMREAD_COLOR); } timestamp_curr = 0; } @@ -544,4 +544,4 @@ bool SequenceCapture::IsOpened() cv::Mat_ SequenceCapture::GetGrayFrame() { return latest_gray_frame; -} \ No newline at end of file +} diff --git a/lib/local/Utilities/src/Visualizer.cpp b/lib/local/Utilities/src/Visualizer.cpp index ac2ca611..6b764fd2 100644 --- a/lib/local/Utilities/src/Visualizer.cpp +++ b/lib/local/Utilities/src/Visualizer.cpp @@ -13,19 +13,19 @@ // reports and manuals, must cite at least one of the following works: // // OpenFace 2.0: Facial Behavior Analysis Toolkit -// Tadas Baltrušaitis, Amir Zadeh, Yao Chong Lim, and Louis-Philippe Morency +// Tadas Baltrušaitis, Amir Zadeh, Yao Chong Lim, and Louis-Philippe Morency // in IEEE International Conference on Automatic Face and Gesture Recognition, 2018 // // Convolutional experts constrained local model for facial landmark detection. -// A. Zadeh, T. Baltrušaitis, and Louis-Philippe Morency, +// A. Zadeh, T. Baltrušaitis, and Louis-Philippe Morency, // in Computer Vision and Pattern Recognition Workshops, 2017. // // Rendering of Eyes for Eye-Shape Registration and Gaze Estimation -// Erroll Wood, Tadas Baltrušaitis, Xucong Zhang, Yusuke Sugano, Peter Robinson, and Andreas Bulling +// Erroll Wood, Tadas Baltrušaitis, Xucong Zhang, Yusuke Sugano, Peter Robinson, and Andreas Bulling // in IEEE International. Conference on Computer Vision (ICCV), 2015 // // Cross-dataset learning and person-specific normalisation for automatic Action Unit detection -// Tadas Baltrušaitis, Marwa Mahmoud, and Peter Robinson +// Tadas Baltrušaitis, Marwa Mahmoud, and Peter Robinson // in Facial Expression Recognition and Analysis Challenge, // IEEE International Conference on Automatic Face and Gesture Recognition, 2015 // @@ -318,7 +318,7 @@ void Visualizer::SetObservationActionUnits(const std::vector