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