|
|
|
@ -144,8 +144,9 @@ StarDetectorComputeResponses( const Mat& img, Mat& responses, Mat& sizes, |
|
|
|
|
{ |
|
|
|
|
const int MAX_PATTERN = 17; |
|
|
|
|
static const int sizes0[] = {1, 2, 3, 4, 6, 8, 11, 12, 16, 22, 23, 32, 45, 46, 64, 90, 128, -1}; |
|
|
|
|
static const int pairs[][2] = {{1, 0}, {3, 1}, {4, 2}, {5, 3}, {7, 4}, {8, 5}, {9, 6}, |
|
|
|
|
{11, 8}, {13, 10}, {14, 11}, {15, 12}, {16, 14}, {-1, -1}}; |
|
|
|
|
static const int pairs[12][2] = {{1, 0}, {3, 1}, {4, 2}, {5, 3}, {7, 4}, {8, 5}, {9, 6}, |
|
|
|
|
{11, 8}, {13, 10}, {14, 11}, {15, 12}, {16, 14}}; |
|
|
|
|
const int MAX_PAIR = sizeof(pairs)/sizeof(pairs[0]); |
|
|
|
|
float invSizes[MAX_PATTERN][2]; |
|
|
|
|
int sizes1[MAX_PATTERN]; |
|
|
|
|
|
|
|
|
@ -172,14 +173,15 @@ StarDetectorComputeResponses( const Mat& img, Mat& responses, Mat& sizes, |
|
|
|
|
responses.create( img.size(), CV_32F ); |
|
|
|
|
sizes.create( img.size(), CV_16S ); |
|
|
|
|
|
|
|
|
|
while( pairs[npatterns][0] >= 0 && ! |
|
|
|
|
while( npatterns < MAX_PAIR && ! |
|
|
|
|
( sizes0[pairs[npatterns][0]] >= maxSize |
|
|
|
|
|| sizes0[pairs[npatterns+1][0]] + sizes0[pairs[npatterns+1][0]]/2 >= std::min(rows, cols) ) ) |
|
|
|
|
{ |
|
|
|
|
++npatterns; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
npatterns += (pairs[npatterns-1][0] >= 0); |
|
|
|
|
if (npatterns-1 < MAX_PAIR) |
|
|
|
|
++npatterns; |
|
|
|
|
maxIdx = pairs[npatterns-1][0]; |
|
|
|
|
|
|
|
|
|
// Create the integral image appropriate for our type & usage
|
|
|
|
|