Skip to content

Commit cbfd662

Browse files
Vladimir Borisenkomitya57
authored andcommitted
Fix crash in Matcher::initialize
1 parent 05f893b commit cbfd662

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

Matcher.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,12 @@ void Matcher::initialize(const vector<Point2f> & pts_fg_norm, const Mat desc_fg,
1717
this->num_bg_points = desc_bg.rows;
1818

1919
//Form database by stacking background and foreground features
20-
vconcat(desc_bg, desc_fg, database);
20+
if (desc_bg.rows > 0 && desc_fg.rows > 0)
21+
vconcat(desc_bg, desc_fg, database);
22+
else if (desc_bg.rows > 0)
23+
database = desc_bg;
24+
else
25+
database = desc_fg;
2126

2227
//Extract descriptor length from features
2328
desc_length = database.cols*8;

0 commit comments

Comments
 (0)