File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -159,3 +159,26 @@ TEST(Features2d_MSER, cases)
159
159
ASSERT_GE (maxRegs, nmsers);
160
160
}
161
161
}
162
+
163
+ TEST (Features2d_MSER, history_update_regression)
164
+ {
165
+ String dataPath = cvtest::TS::ptr ()->get_data_path () + " mser/" ;
166
+ vector<Mat> tstImages;
167
+ tstImages.push_back (imread (dataPath + " mser_test.png" , IMREAD_GRAYSCALE));
168
+ tstImages.push_back (imread (dataPath + " mser_test2.png" , IMREAD_GRAYSCALE));
169
+
170
+ for (size_t j = 0 ; j < tstImages.size (); j++)
171
+ {
172
+ size_t previous_size = 0 ;
173
+ for (int minArea = 100 ; minArea > 10 ; minArea--)
174
+ {
175
+ Ptr<MSER> mser = MSER::create (1 , minArea, (int )(tstImages[j].cols * tstImages[j].rows * 0.2 ));
176
+ mser->setPass2Only (true );
177
+ vector<vector<Point> > mserContours;
178
+ vector<Rect> boxRects;
179
+ mser->detectRegions (tstImages[j], mserContours, boxRects);
180
+ ASSERT_LE (previous_size, mserContours.size ());
181
+ previous_size = mserContours.size ();
182
+ }
183
+ }
184
+ }
You can’t perform that action at this time.
0 commit comments