Skip to content

Commit c7f2e2a

Browse files
bitsunalalek
authored andcommitted
Merge pull request #2074 from bitsun:master
* fix rectifyPatch bug when patch orientation is not extracted
1 parent f6d0e94 commit c7f2e2a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

modules/xfeatures2d/src/boostdesc.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -364,9 +364,10 @@ static void rectifyPatch( const Mat& image, const KeyPoint& kp,
364364
}
365365
else
366366
{
367-
float M_[] = {
368-
1.f, 0.f, -1.f * patchSize/2.0f + kp.pt.x,
369-
0.f, 1.f, -1.f * patchSize/2.0f + kp.pt.y
367+
const float s = scale_factor * (float)kp.size / (float)patchSize;
368+
float M_[] = {
369+
s, 0.f, -s * patchSize/2.0f + kp.pt.x,
370+
0.f, s, -s * patchSize/2.0f + kp.pt.y
370371
};
371372
M = Mat( 2, 3, CV_32FC1, M_ ).clone();
372373
}

0 commit comments

Comments
 (0)