War on Whitespace, master edition: trailing spaces.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
// A demo program of the Extremal Region Filter algorithm described in
|
||||
// A demo program of the Extremal Region Filter algorithm described in
|
||||
// Neumann L., Matas J.: Real-Time Scene Text Localization and Recognition, CVPR 2012
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -21,7 +21,7 @@ void er_draw(Mat &src, Mat &dst, ERStat& er);
|
||||
void er_draw(Mat &src, Mat &dst, ERStat& er)
|
||||
{
|
||||
|
||||
if (er.parent != NULL) // deprecate the root region
|
||||
if (er.parent != NULL) // deprecate the root region
|
||||
{
|
||||
int newMaskVal = 255;
|
||||
int flags = 4 + (newMaskVal << 8) + FLOODFILL_FIXED_RANGE + FLOODFILL_MASK_ONLY;
|
||||
@@ -29,7 +29,7 @@ void er_draw(Mat &src, Mat &dst, ERStat& er)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
int main(int argc, const char * argv[])
|
||||
{
|
||||
|
||||
@@ -54,14 +54,14 @@ int main(int argc, const char * argv[])
|
||||
}
|
||||
Mat grey(original.size(),CV_8UC1);
|
||||
cvtColor(original,grey,COLOR_RGB2GRAY);
|
||||
|
||||
|
||||
double t = (double)getTickCount();
|
||||
|
||||
|
||||
// Build ER tree and filter with the 1st stage default classifier
|
||||
Ptr<ERFilter> er_filter1 = createERFilterNM1();
|
||||
|
||||
|
||||
er_filter1->run(grey, regions);
|
||||
|
||||
|
||||
t = (double)getTickCount() - t;
|
||||
cout << " --------------------------------------------------------------------------------------------------" << endl;
|
||||
cout << "\t FIRST STAGE CLASSIFIER done in " << t * 1000. / getTickFrequency() << " ms." << endl;
|
||||
@@ -87,11 +87,11 @@ int main(int argc, const char * argv[])
|
||||
}
|
||||
|
||||
t = (double)getTickCount();
|
||||
|
||||
|
||||
// Default second stage classifier
|
||||
Ptr<ERFilter> er_filter2 = createERFilterNM2();
|
||||
er_filter2->run(grey, regions);
|
||||
|
||||
|
||||
t = (double)getTickCount() - t;
|
||||
cout << " --------------------------------------------------------------------------------------------------" << endl;
|
||||
cout << "\t SECOND STAGE CLASSIFIER done in " << t * 1000. / getTickFrequency() << " ms." << endl;
|
||||
|
@@ -17,7 +17,7 @@ static void help(char** argv)
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
if(argc != 2)
|
||||
if(argc != 2)
|
||||
{
|
||||
help(argv);
|
||||
return 1;
|
||||
@@ -25,28 +25,28 @@ int main(int argc, char** argv)
|
||||
|
||||
string first_file = argv[1];
|
||||
VideoCapture sequence(first_file);
|
||||
|
||||
|
||||
if (!sequence.isOpened())
|
||||
{
|
||||
cerr << "Failed to open the image sequence!\n" << endl;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
Mat image;
|
||||
namedWindow("Image sequence | press ESC to close", 1);
|
||||
|
||||
|
||||
for(;;)
|
||||
{
|
||||
// Read in image from sequence
|
||||
sequence >> image;
|
||||
|
||||
|
||||
// If no image was retrieved -> end of sequence
|
||||
if(image.empty())
|
||||
{
|
||||
cout << "End of Sequence" << endl;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
imshow("Image sequence | press ESC to close", image);
|
||||
|
||||
if(waitKey(500) == 27)
|
||||
|
@@ -41,15 +41,15 @@ namespace {
|
||||
cout << "press space to save a picture. q or esc to quit" << endl;
|
||||
namedWindow(window_name, WINDOW_KEEPRATIO); //resizable window;
|
||||
Mat frame;
|
||||
|
||||
|
||||
for (;;) {
|
||||
capture >> frame;
|
||||
if (frame.empty())
|
||||
break;
|
||||
|
||||
|
||||
imshow(window_name, frame);
|
||||
char key = (char)waitKey(30); //delay N millis, usually long enough to display and capture input
|
||||
|
||||
|
||||
switch (key) {
|
||||
case 'q':
|
||||
case 'Q':
|
||||
|
Reference in New Issue
Block a user