Improve formatting and log messages
This commit is contained in:
parent
3e15600268
commit
657e802208
15
example.cpp
15
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;
|
||||
}
|
Loading…
Reference in New Issue