Improve formatting and log messages

This commit is contained in:
mmcwilliams 2023-02-05 18:43:38 -05:00
parent 3e15600268
commit 657e802208
1 changed files with 11 additions and 4 deletions

View File

@ -39,12 +39,17 @@ int main(int argc, char** argv)
Mat inverted; Mat inverted;
string input; string input;
if (argc == 2) { if (argc == 2)
{
input = argv[1]; input = argv[1];
} else if (argc < 2) { }
else if (argc < 2)
{
cerr << "Please provide one image." << endl; cerr << "Please provide one image." << endl;
return -1; return -1;
} else if (argc > 2) { }
else if (argc > 2)
{
cerr << "Please provide only one image." << endl; cerr << "Please provide only one image." << endl;
return -2; return -2;
} }
@ -61,6 +66,8 @@ int main(int argc, char** argv)
return -4; return -4;
} }
cout << "Using image " << input << "." << endl;
image = imread(input); image = imread(input);
bitwise_not(image, inverted); bitwise_not(image, inverted);
imshow("Image", inverted); imshow("Image", inverted);
@ -69,7 +76,7 @@ int main(int argc, char** argv)
destroyAllWindows(); destroyAllWindows();
cout << "Using image " << input << "." << endl;
return 0; return 0;
} }