Skip to content

Commit c7ae26b

Browse files
committed
Merge pull request opencv#7879 from alalek:backport_7852
2 parents 22df206 + 8444c23 commit c7ae26b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

modules/features2d/src/orb.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -736,7 +736,9 @@ void ORB::operator()( InputArray _image, InputArray _mask, vector<KeyPoint>& _ke
736736
//ROI handling
737737
const int HARRIS_BLOCK_SIZE = 9;
738738
int halfPatchSize = patchSize / 2;
739-
int border = std::max(edgeThreshold, std::max(halfPatchSize, HARRIS_BLOCK_SIZE/2))+1;
739+
// sqrt(2.0) is for handling patch rotation
740+
int descPatchSize = cvCeil(halfPatchSize*sqrt(2.0));
741+
int border = std::max(edgeThreshold, std::max(descPatchSize, HARRIS_BLOCK_SIZE/2))+1;
740742

741743
Mat image = _image.getMat(), mask = _mask.getMat();
742744
if( image.type() != CV_8UC1 )

0 commit comments

Comments
 (0)