Skip to content

Commit 31aa69f

Browse files
committed
Merge pull request opencv#8708 from terfendail:agast_fix
2 parents 0d60c0e + ee5b5a6 commit 31aa69f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

modules/features2d/src/agast_score.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,15 @@ void makeAgastOffsets(int pixel[16], int rowStride, int type)
8282
type == AgastFeatureDetector::AGAST_7_12s ? offsets12s :
8383
type == AgastFeatureDetector::AGAST_5_8 ? offsets8 : 0;
8484

85+
const int offsets_len = type == AgastFeatureDetector::OAST_9_16 ? 16 :
86+
type == AgastFeatureDetector::AGAST_7_12d ? 12 :
87+
type == AgastFeatureDetector::AGAST_7_12s ? 12 :
88+
type == AgastFeatureDetector::AGAST_5_8 ? 8 : 0;
89+
8590
CV_Assert(pixel && offsets);
8691

8792
int k = 0;
88-
for( ; k < 16; k++ )
93+
for( ; k < offsets_len; k++ )
8994
pixel[k] = offsets[k][0] + offsets[k][1] * rowStride;
9095
}
9196

0 commit comments

Comments
 (0)