Commit 8511c9fc authored by Vladimir Dudnik's avatar Vladimir Dudnik

cosmetic changes, removed trailing spaces

parent e92d0e4b
...@@ -567,7 +567,6 @@ struct SURFInvoker ...@@ -567,7 +567,6 @@ struct SURFInvoker
DW[i*PATCH_SZ+j] = G_desc.at<float>(i,0) * G_desc.at<float>(j,0); DW[i*PATCH_SZ+j] = G_desc.at<float>(i,0) * G_desc.at<float>(j,0);
} }
} }
void operator()(const BlockedRange& range) const void operator()(const BlockedRange& range) const
{ {
/* X and Y gradient wavelet data */ /* X and Y gradient wavelet data */
...@@ -576,7 +575,6 @@ struct SURFInvoker ...@@ -576,7 +575,6 @@ struct SURFInvoker
const int dy_s[NY][5] = {{0, 0, 4, 2, 1}, {0, 2, 4, 4, -1}}; const int dy_s[NY][5] = {{0, 0, 4, 2, 1}, {0, 2, 4, 4, -1}};
const int descriptor_size = params->extended ? 128 : 64; const int descriptor_size = params->extended ? 128 : 64;
/* Optimisation is better using nOriSampleBound than nOriSamples for /* Optimisation is better using nOriSampleBound than nOriSamples for
array lengths. Maybe because it is a constant known at compile time */ array lengths. Maybe because it is a constant known at compile time */
const int nOriSampleBound =(2*ORI_RADIUS+1)*(2*ORI_RADIUS+1); const int nOriSampleBound =(2*ORI_RADIUS+1)*(2*ORI_RADIUS+1);
...@@ -591,32 +589,25 @@ struct SURFInvoker ...@@ -591,32 +589,25 @@ struct SURFInvoker
int k, k1 = range.begin(), k2 = range.end(); int k, k1 = range.begin(), k2 = range.end();
int maxSize = 0; int maxSize = 0;
for( k = k1; k < k2; k++ ) for( k = k1; k < k2; k++ )
{ {
maxSize = std::max(maxSize, ((CvSURFPoint*)cvGetSeqElem( keypoints, k ))->size); maxSize = std::max(maxSize, ((CvSURFPoint*)cvGetSeqElem( keypoints, k ))->size);
} }
maxSize = cvCeil((PATCH_SZ+1)*maxSize*1.2f/9.0f); maxSize = cvCeil((PATCH_SZ+1)*maxSize*1.2f/9.0f);
Ptr<CvMat> winbuf = cvCreateMat( 1, maxSize > 0 ? maxSize*maxSize : 1, CV_8U ); Ptr<CvMat> winbuf = cvCreateMat( 1, maxSize > 0 ? maxSize*maxSize : 1, CV_8U );
for( k = k1; k < k2; k++ ) for( k = k1; k < k2; k++ )
{ {
const int* sum_ptr = sum->data.i; const int* sum_ptr = sum->data.i;
int sum_cols = sum->cols; int sum_cols = sum->cols;
int i, j, kk, x, y, nangle; int i, j, kk, x, y, nangle;
float* vec; float* vec;
CvSurfHF dx_t[NX], dy_t[NY]; CvSurfHF dx_t[NX], dy_t[NY];
CvSURFPoint* kp = (CvSURFPoint*)cvGetSeqElem( keypoints, k ); CvSURFPoint* kp = (CvSURFPoint*)cvGetSeqElem( keypoints, k );
int size = kp->size; int size = kp->size;
CvPoint2D32f center = kp->pt; CvPoint2D32f center = kp->pt;
/* The sampling intervals and wavelet sized for selecting an orientation /* The sampling intervals and wavelet sized for selecting an orientation
and building the keypoint descriptor are defined relative to 's' */ and building the keypoint descriptor are defined relative to 's' */
float s = (float)size*1.2f/9.0f; float s = (float)size*1.2f/9.0f;
/* To find the dominant orientation, the gradients in x and y are /* To find the dominant orientation, the gradients in x and y are
sampled in a circle of radius 6s using wavelets of size 4s. sampled in a circle of radius 6s using wavelets of size 4s.
We ensure the gradient wavelet size is even to ensure the We ensure the gradient wavelet size is even to ensure the
...@@ -680,19 +671,14 @@ struct SURFInvoker ...@@ -680,19 +671,14 @@ struct SURFInvoker
besty = sumy; besty = sumy;
} }
} }
float descriptor_dir = cvFastArctan( besty, bestx ); float descriptor_dir = cvFastArctan( besty, bestx );
kp->dir = descriptor_dir; kp->dir = descriptor_dir;
if( !descriptors ) if( !descriptors )
continue; continue;
descriptor_dir *= (float)(CV_PI/180); descriptor_dir *= (float)(CV_PI/180);
/* Extract a window of pixels around the keypoint of size 20s */ /* Extract a window of pixels around the keypoint of size 20s */
int win_size = (int)((PATCH_SZ+1)*s); int win_size = (int)((PATCH_SZ+1)*s);
CV_Assert( winbuf->cols >= win_size*win_size ); CV_Assert( winbuf->cols >= win_size*win_size );
CvMat win = cvMat(win_size, win_size, CV_8U, winbuf->data.ptr); CvMat win = cvMat(win_size, win_size, CV_8U, winbuf->data.ptr);
float sin_dir = sin(descriptor_dir); float sin_dir = sin(descriptor_dir);
float cos_dir = cos(descriptor_dir) ; float cos_dir = cos(descriptor_dir) ;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment