From 2f667bf23db542d8b7cc523c9bea99d4096ae0e9 Mon Sep 17 00:00:00 2001 From: Tadas Baltrusaitis Date: Mon, 1 Aug 2016 10:14:58 -0400 Subject: [PATCH] Ubuntu case sensitivity fix in travis test, making sure a check is made to see if image output is successful. --- .travis.yml | 2 +- exe/FaceLandmarkImg/FaceLandmarkImg.cpp | 16 ++++++++++++++-- exe/FeatureExtraction/FeatureExtraction.cpp | 9 +++++++-- 3 files changed, 22 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index beb9f1b..6b0918d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -65,7 +65,7 @@ script: - cmake -D CMAKE_BUILD_TYPE=RELEASE .. - make -j2 - ../build/bin/FaceLandmarkImg -fdir "../videos/" -ofdir "./demo_img/" -oidir "./demo_img/" -wild -q - - ../build/bin/FaceLandmarkImg -inroot ../videos -f obama.jpg -outroot data -of obama.txt -op obama.3d -oi obama.bmp -multi_view 1 -wild -q + - ../build/bin/FaceLandmarkImg -inroot ../videos -f Obama.jpg -outroot data -of obama.txt -op obama.3d -oi obama.bmp -multi_view 1 -wild -q - ../build/bin/FaceLandmarkVidMulti -inroot ../videos -f multi_face.avi -outroot output -ov multi_face.avi -q - ../build/bin/FeatureExtraction -f "../videos/1815_01_008_tony_blair.avi" -outroot output_features -ov blair.avi -of "1815_01_008_tony_blair.txt" -simalign aligned -ov feat_test.avi -hogalign hog_test.dat -q - ../build/bin/FaceLandmarkVid -inroot ../videos -f 1815_01_008_tony_blair.avi -f 0188_03_021_al_pacino.avi -f 0217_03_006_alanis_morissette.avi -outroot output_data -ov 1.avi -ov 2.avi -ov 3.avi -q \ No newline at end of file diff --git a/exe/FaceLandmarkImg/FaceLandmarkImg.cpp b/exe/FaceLandmarkImg/FaceLandmarkImg.cpp index b25aabd..931bc84 100644 --- a/exe/FaceLandmarkImg/FaceLandmarkImg.cpp +++ b/exe/FaceLandmarkImg/FaceLandmarkImg.cpp @@ -557,8 +557,14 @@ int main (int argc, char **argv) boost::filesystem::path ext = out_feat_path.extension(); outimage = dir.string() + preferredSlash + fname.string() + string(name) + ext.string(); create_directory_from_file(outimage); - imwrite(outimage, display_image); + bool write_success = cv::imwrite(outimage, display_image); + if (!write_success) + { + cout << "Could not output a processed image" << endl; + return 1; + } + } } @@ -630,7 +636,13 @@ int main (int argc, char **argv) if(!outimage.empty()) { create_directory_from_file(outimage); - imwrite(outimage, display_image); + bool write_success = imwrite(outimage, display_image); + + if (!write_success) + { + cout << "Could not output a processed image" << endl; + return 1; + } } } } diff --git a/exe/FeatureExtraction/FeatureExtraction.cpp b/exe/FeatureExtraction/FeatureExtraction.cpp index dffffa8..b49b143 100644 --- a/exe/FeatureExtraction/FeatureExtraction.cpp +++ b/exe/FeatureExtraction/FeatureExtraction.cpp @@ -621,8 +621,13 @@ int main (int argc, char **argv) std::string preferredSlash = slash.make_preferred().string(); string out_file = output_similarity_align[f_n] + preferredSlash + string(name); - imwrite(out_file, sim_warped_img); - + bool write_success = imwrite(out_file, sim_warped_img); + + if (!write_success) + { + cout << "Could not output similarity aligned image image" << endl; + return 1; + } } // Visualising the tracker