From 657e802208f58ac656fbe3b86858945e450aec21 Mon Sep 17 00:00:00 2001 From: mmcwilliams Date: Sun, 5 Feb 2023 18:43:38 -0500 Subject: [PATCH] Improve formatting and log messages --- example.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/example.cpp b/example.cpp index 3ea7fec..b8df681 100644 --- a/example.cpp +++ b/example.cpp @@ -39,12 +39,17 @@ int main(int argc, char** argv) Mat inverted; string input; - if (argc == 2) { + if (argc == 2) + { input = argv[1]; - } else if (argc < 2) { + } + else if (argc < 2) + { cerr << "Please provide one image." << endl; return -1; - } else if (argc > 2) { + } + else if (argc > 2) + { cerr << "Please provide only one image." << endl; return -2; } @@ -61,6 +66,8 @@ int main(int argc, char** argv) return -4; } + cout << "Using image " << input << "." << endl; + image = imread(input); bitwise_not(image, inverted); imshow("Image", inverted); @@ -69,7 +76,7 @@ int main(int argc, char** argv) destroyAllWindows(); - cout << "Using image " << input << "." << endl; + return 0; } \ No newline at end of file