42 #ifdef SIFTGPU_USE_SSE_FOR
44 #error Compiling SSE functions but SSE is not supported by the compiler.
46 #include <xmmintrin.h>
50 #define USE_TIMING() double t, t0, tt;
51 #define OCTAVE_START() if(GlobalUtil::_timingO){ t = t0 = CLOCK(); cout<<"#"<<i+_down_sample_factor<<"\t"; }
52 #define LEVEL_FINISH() if(GlobalUtil::_timingL){ glFinish(); tt = CLOCK();cout<<(tt-t)<<"\t"; t = CLOCK();}
53 #define OCTAVE_FINISH() if(GlobalUtil::_timingO)cout<<"|\t"<<(CLOCK()-t0)<<endl;
76 }
else if(num < align*align)
79 fh = (int)
ceil(
double(num) / fw);
82 double dn = double(num);
85 fh = (int)
ceil(dn /fw);
88 double dn = double(num);
93 fw = (int)
ceil(dn / fh);
95 fw = ((int)
ceil(
double(fw) /align))*align;
117 double dn = double(num);
120 fh = (int)
ceil(dn /fw);
123 double dn = double(num);
128 fw = (int)
ceil(dn / fh);
257 for(
int k = 0; k <hist_level_num -1; k++, htex--)
265 w = (w + 1)>>1; h = (h + 1) >> 1;
279 if(_octave_num < 1 || _octave_num > _octave_num_max)
309 int wp, hp, toobig = 0;
354 std::cout<<(toobig == 2 ?
"[**SKIP OCTAVES**]:\tExceeding Memory Cap (-nomc)\n" :
355 "[**SKIP OCTAVES**]:\tReaching the dimension limit (-maxd)!\n");
383 unsigned int totalkb = 0;
384 int _octave_num_new, input_sz;
400 input_sz =
min(w,h) ;
434 for(i = 0; i< noct; i++)
436 totalkb += (nlev * w * h * 16 / 1024);
437 for( j = 0; j< nlev; j++, tex++)
443 totalkb += ((nlev - 3) * w * h * 16 /1024);
444 for( j = 0; j< nlev ; j++, aux++)
447 if(j >= nlev - 1)
continue;
484 int num = (int)
ceil(log(
double(
max(wmax, hmax)))/log(2.0));
526 else if(fmax < 32) fmax = 32;
572 if(fh < hmax ) fh = hmax;
573 if(fw < wmax ) fw = wmax;
575 totalkb += ( fw * fh * nf * 16 /1024);
576 for(i =0; i < nf; i++)
596 glDrawBuffer(GL_COLOR_ATTACHMENT0_EXT);
698 glDrawBuffer(GL_COLOR_ATTACHMENT0_EXT);
717 std::cout<<
"<Compute Gradient>\t"<<(t1-ts)<<
"\n";
730 double t0, t, ts, t1, t2;
736 glDrawBuffer(GL_COLOR_ATTACHMENT0_EXT);
742 for( j =0; j < n_gradient_only_level ; j++)
759 GLenum buffers[] = { GL_COLOR_ATTACHMENT0_EXT, GL_COLOR_ATTACHMENT1_EXT };
760 glDrawBuffers(2, buffers);
777 glActiveTexture(GL_TEXTURE0);
779 glActiveTexture(GL_TEXTURE1);
781 glActiveTexture(GL_TEXTURE2);
789 std::cout<<(
CLOCK()-t)<<
"\t";
796 std::cout<<
"|\t"<<(
CLOCK()-t0)<<
"\n";
805 std::cout <<
"<Get Keypoints .. >\t"<<(t2-t1)<<
"\n"
806 <<
"<Extra Gradient.. >\t"<<(t1-ts)<<
"\n";
826 glActiveTexture(GL_TEXTURE0);
843 for(
int k = 0; k <hist_level_num - i - 1 - hist_skip_gpu; k++, htex--)
853 if(hist_skip_gpu == 0)
857 glReadPixels(0, 0, 1, 1, GL_RGBA , GL_FLOAT, fn);
858 fcount = (fn[0] + fn[1] + fn[2] + fn[3]);
859 if(fcount < 1) fcount = 0;
867 if(fcount < 1.0)
return;
882 glClear(GL_COLOR_BUFFER_BIT);
904 glReadPixels(0, 0, tw, th, GL_RGBA , GL_FLOAT,
_histo_buffer);
906 for(
int y = 0, pos = 0; y < th; y++)
908 for(
int x= 0; x < tw; x++)
910 for(
int c = 0; c < 4; c++, pos++)
913 if(ss == 0)
continue;
914 float ft[4] = {2 * x + (c%2? 1.5f: 0.5f), 2 * y + (c>=2? 1.5f: 0.5f), 0, 1 };
915 for(
int t = 0; t < ss; t++)
933 glClear(GL_COLOR_BUFFER_BIT);
942 glActiveTexture(GL_TEXTURE0);
949 for(
int lev = 1 + hist_skip_gpu; lev < hist_level_num - i; lev++, htex++)
952 glActiveTexture(GL_TEXTURE0);
955 glActiveTexture(GL_TEXTURE1);
970 glReadBuffer(GL_COLOR_ATTACHMENT0_EXT);
971 glDrawBuffer(GL_COLOR_ATTACHMENT0_EXT);
1011 std::cout <<
"| \t" << int(ocount) <<
" :\t(" << (t2 - t1) <<
")\n";
1025 int w, h, esize; GLint bsize;
1040 glReadBuffer(GL_COLOR_ATTACHMENT0_EXT);
1041 glDrawBuffer(GL_COLOR_ATTACHMENT0_EXT);
1042 glActiveTexture(GL_TEXTURE0);
1063 glGetBufferParameteriv(GL_PIXEL_PACK_BUFFER_ARB, GL_BUFFER_SIZE, &bsize);
1069 glBufferData(GL_PIXEL_PACK_BUFFER_ARB, esize*3/2 ,
NULL, GL_STATIC_DRAW_ARB);
1070 glGetBufferParameteriv(GL_PIXEL_PACK_BUFFER_ARB, GL_BUFFER_SIZE, &bsize);
1075 else glBufferData(GL_PIXEL_PACK_BUFFER_ARB, 0,
NULL, GL_STATIC_DRAW_ARB);
1076 glBindBuffer(GL_PIXEL_PACK_BUFFER_ARB, 0);
1098 glGetBufferParameteriv(GL_PIXEL_PACK_BUFFER_ARB, GL_BUFFER_SIZE, &bsize);
1099 esize = w*h *
sizeof(float)*4;
1103 glBufferData(GL_PIXEL_PACK_BUFFER_ARB, esize*3/2,
NULL, GL_STATIC_DRAW_ARB);
1104 glGetBufferParameteriv(GL_PIXEL_PACK_BUFFER_ARB, GL_BUFFER_SIZE, &bsize);
1108 if(bsize >= esize) glReadPixels(0, 0, w, h, GL_RGBA, GL_FLOAT, 0);
1109 else glBufferData(GL_PIXEL_PACK_BUFFER_ARB, 0,
NULL, GL_STATIC_DRAW_ARB);
1110 glBindBuffer(GL_PIXEL_PACK_BUFFER_ARB, 0);
1117 glReadBuffer(GL_NONE);
1138 GLenum buffers[] = { GL_COLOR_ATTACHMENT0_EXT, GL_COLOR_ATTACHMENT1_EXT };
1139 glDrawBuffers(2, buffers);
1142 glDrawBuffer(GL_COLOR_ATTACHMENT0_EXT);
1152 if(*
count<=0)
continue;
1157 ftex->FitTexViewPort();
1159 glActiveTexture(GL_TEXTURE0);
1161 glActiveTexture(GL_TEXTURE1);
1164 ftex->AttachToFBO(0);
1168 glActiveTexture(GL_TEXTURE2);
1173 gtex->GetImgWidth(), gtex->GetImgHeight(),
1217 for(
int m = 0; m < tex->
GetTexWidth(); m ++, p++)
1221 list.push_back(m+0.5f);
1222 list.push_back(k+0.5f);
1230 if(fcount==0)
continue;
1244 list.resize(4*fh*fw);
1261 #define FEATURELIST_USE_PBO
1270 int i, szmax =0, sz;
1272 for( i = 0; i < n; i++)
1275 if(sz > szmax ) szmax = sz;
1277 float * buffer =
new float[szmax*24];
1278 float * buffer1 = buffer;
1279 float * buffer2 = buffer + szmax*4;
1280 float * buffer3 = buffer + szmax*8;
1282 glReadBuffer(GL_COLOR_ATTACHMENT0_EXT);
1283 glDrawBuffer(GL_COLOR_ATTACHMENT0_EXT);
1285 #ifdef FEATURELIST_USE_PBO
1286 GLuint ListUploadPBO;
1287 glGenBuffers(1, &ListUploadPBO);
1288 glBindBuffer(GL_PIXEL_UNPACK_BUFFER_ARB, ListUploadPBO);
1289 glBufferData(GL_PIXEL_UNPACK_BUFFER_ARB, szmax * 8 *
sizeof(
float),
NULL, GL_STREAM_DRAW);
1294 #ifdef NO_DUPLICATE_DOWNLOAD
1295 const double twopi = 2.0*3.14159265358979323846;
1302 for(i = 0; i < n; i++)
1308 glReadPixels(0, 0,
_featureTex[i].GetImgWidth(),
_featureTex[i].GetImgHeight(),GL_RGBA, GL_FLOAT, buffer1);
1310 int fcount =0, ocount;
1311 float * src = buffer1;
1312 float * orientation = buffer2;
1313 float * des = buffer3;
1326 des[2] = orientation[0];
1332 ocount = (int)src[2];
1333 for(
int k = 0 ; k < ocount; k++, des+=4)
1337 des[2] = orientation[k];
1346 const static double factor = 2.0*3.14159265358979323846/65535.0;
1349 unsigned short * orientations = (
unsigned short*) (&src[2]);
1354 des[2] = float( factor* orientations[0]);
1360 if(orientations[0] != 65535)
1364 des[2] = float( factor* orientations[0]);
1369 if(orientations[1] != 65535)
1373 des[2] = float(factor* orientations[1]);
1390 if(sz > fcount) memset(des, 0,
sizeof(
float) * (sz - fcount) * 4);
1392 #ifndef FEATURELIST_USE_PBO
1397 float* mem = (
float*) glMapBuffer(GL_PIXEL_UNPACK_BUFFER_ARB, GL_WRITE_ONLY);
1398 memcpy(mem, buffer3, sz * 4 *
sizeof(
float) );
1399 glUnmapBuffer(GL_PIXEL_UNPACK_BUFFER_ARB);
1405 #ifdef NO_DUPLICATE_DOWNLOAD
1411 float* fs = buffer3;
1412 for(
int k = 0; k < fcount; k++, ds+=4, fs+=4)
1414 ds[0] = oss*(fs[0]-0.5f) +
offset;
1415 ds[1] = oss*(fs[1]-0.5f) +
offset;
1416 ds[3] = (float)fmod(twopi-fs[2], twopi);
1431 #ifdef FEATURELIST_USE_PBO
1432 glBindBuffer(GL_PIXEL_UNPACK_BUFFER_ARB, 0);
1433 glDeleteBuffers(1, &ListUploadPBO);
1452 fh = fcount ==0? 0:(int)
ceil(
double(fcount)/fw);
1454 fw = fcount ==0? 0:(int)
ceil(
double(fcount)/fh);
1476 glDrawBuffer(GL_COLOR_ATTACHMENT0_EXT);
1486 ftex->AttachToFBO(0);
1487 ftex->FitTexViewPort();
1489 glActiveTexture(GL_TEXTURE0);
1491 glActiveTexture(GL_TEXTURE1);
1504 #ifdef SIFTGPU_USE_SSE_FOR
1505 static inline float dotproduct_128d(
float * p)
1508 __m128 sse =_mm_load_ss(&z);
1509 float* pf = (
float*) (&sse);
1510 for(
int i = 0; i < 32; i++, p+=4)
1512 __m128 ps = _mm_loadu_ps(p);
1513 sse = _mm_add_ps(sse, _mm_mul_ps(ps, ps));
1515 return pf[0] + pf[1] + pf[2] + pf[3];
1518 static inline void multiply_and_truncate_128d(
float* p,
float m)
1521 __m128 t = _mm_load_ps1(&z);
1522 __m128 r = _mm_load_ps1(&m);
1523 for(
int i = 0; i < 32; i++, p+=4)
1525 __m128 ps = _mm_loadu_ps(p);
1526 _mm_storeu_ps(p, _mm_min_ps(_mm_mul_ps(ps, r), t));
1529 static inline void multiply_128d(
float* p,
float m)
1531 __m128 r = _mm_load_ps1(&m);
1532 for(
int i = 0; i < 32; i++, p+=4)
1534 __m128 ps = _mm_loadu_ps(p);
1535 _mm_storeu_ps(p, _mm_mul_ps(ps, r));
1544 #ifdef SIFTGPU_USE_SSE_FOR
1545 for(
int k = 0; k < num; k++, pd +=128)
1549 sq = dotproduct_128d(pd); sq = 1.0f / sqrtf(sq);
1550 multiply_and_truncate_128d(pd, sq);
1553 sq = dotproduct_128d(pd); sq = 1.0f / sqrtf(sq);
1554 multiply_128d(pd, sq);
1558 for(
int k = 0; k < num; k++, pd +=128)
1565 for(v = 0 ; v < 128; v++, ppd++) sq += (*ppd)*(*ppd);
1566 sq = 1.0f / sqrtf(sq);
1569 for(v = 0; v < 128; v ++, ppd++) *ppd =
min(*ppd*sq, 0.2f);
1573 for(v = 0; v < 128; v++, ppd++) sq += (*ppd)*(*ppd);
1574 sq = 1.0f / sqrtf(sq);
1577 for(v = 0; v < 128; v ++, ppd++) *ppd = *ppd*sq;
1621 for(
int k = 0; k < 2; k++)
1623 float* pp = buf + k * step;
1624 float* ppd = pd + k * 4;
1625 for(
int u = 0; u < h ; u++)
1628 for(v= 0; v < w; v++)
1630 for(
int t = 0; t < 8; t++)
1641 ppd += ( 64 - 128 * w );
1642 for(v= 0; v < w; v++)
1644 for(
int t = 0; t < 8; t++)
1671 int idx, i, j, k, w, h;
1676 vector<float>read_buffer, descriptor_buffer2;
1682 pd = &descriptor_buffer2[0];
1687 GLenum buffers[8] = {
1688 GL_COLOR_ATTACHMENT0_EXT, GL_COLOR_ATTACHMENT1_EXT ,
1689 GL_COLOR_ATTACHMENT2_EXT, GL_COLOR_ATTACHMENT3_EXT ,
1690 GL_COLOR_ATTACHMENT4_EXT, GL_COLOR_ATTACHMENT5_EXT ,
1691 GL_COLOR_ATTACHMENT6_EXT, GL_COLOR_ATTACHMENT7_EXT ,
1694 glDrawBuffers(ndf, buffers);
1695 glReadBuffer(GL_COLOR_ATTACHMENT0_EXT);
1709 h = ((int)
ceil(
double(
count) / w)) * block_height;
1718 glActiveTexture(GL_TEXTURE0);
1720 glActiveTexture(GL_TEXTURE1);
1724 glActiveTexture(GL_TEXTURE2);
1729 w, ftex->GetImgWidth(), gtex->GetImgWidth(), gtex->GetImgHeight(), sigma);
1734 if((
unsigned int)step*ndf > read_buffer.size())
1736 read_buffer.resize(ndf*step);
1738 pbuf = &read_buffer[0];
1741 for(k = 0; k < ndf; k++, pbuf+=step)
1743 glReadBuffer(GL_COLOR_ATTACHMENT0_EXT + k);
1746 glReadPixels(0, 0, w, h, GL_RGBA, GL_FLOAT, pbuf);
1749 int hstep = 16384 / w;
1750 for(
int kk = 0; kk < h; kk += hstep)
1751 glReadPixels(0, kk, w,
min(hstep, h - kk), GL_RGBA, GL_FLOAT, pbuf + w * kk * 4);
1765 glReadBuffer(GL_NONE);
1776 memcpy(&
_descriptor_buffer[index*128], &descriptor_buffer2[i*128], 128 *
sizeof(
float));
1782 glDrawBuffer(GL_NONE);
1785 for(i = 0; i < ndf; i++) fbo.
UnattachTex(GL_COLOR_ATTACHMENT0_EXT +i);
1792 const double twopi = 2.0*3.14159265358979323846;
1795 vector<float> keypoint_buffer2;
1801 buffer = &keypoint_buffer2[0];
1803 float * p = buffer, *ps, sigma;
1825 ps[0] = os*(ps[0]-0.5f) +
offset;
1826 ps[1] = os*(ps[1]-0.5f) +
offset;
1828 ps[3] = (float)fmod(twopi-ps[2], twopi);
1843 memcpy(&
_keypoint_buffer[index*4], &keypoint_buffer2[i*4], 4 *
sizeof(
float));
1857 const double twopi = 2.0*3.14159265358979323846;
1867 for(
int i = 0; i <
_octave_num; i++, octave_sigma*= 2.0f)
1873 float sigma_min = level_sigma / sigma_half_step;
1874 float sigma_max = level_sigma * sigma_half_step;
1879 float sigmak = key[2];
1884 if( (sigmak >= sigma_min && sigmak < sigma_max)
1885 ||(sigmak < sigma_min && i ==0 && j == 0)
1890 list.push_back((key[0] -
offset) / octave_sigma + 0.5f);
1891 list.push_back((key[1] -
offset) / octave_sigma + 0.5f);
1894 list.push_back(key[2] / octave_sigma);
1895 list.push_back(key[3] / octave_sigma);
1898 list.push_back((
float)fmod(twopi-key[3], twopi));
1899 list.push_back(key[2] / octave_sigma);
1908 if(fcount==0)
continue;
1916 list.resize(4*fh*fw);
1956 glDrawBuffer(GL_COLOR_ATTACHMENT0_EXT);
1999 GLenum buffers[4] = {
2000 GL_COLOR_ATTACHMENT0_EXT, GL_COLOR_ATTACHMENT1_EXT ,
2001 GL_COLOR_ATTACHMENT2_EXT, GL_COLOR_ATTACHMENT3_EXT
2016 glDrawBuffers(3, buffers);
2022 glActiveTexture(GL_TEXTURE0);
2024 glActiveTexture(GL_TEXTURE1);
2041 std::cout <<
"<Gradient, DOG >\t"<<(t1-ts)<<
"\n";
2055 GLenum buffers[4] = {
2056 GL_COLOR_ATTACHMENT0_EXT, GL_COLOR_ATTACHMENT1_EXT ,
2057 GL_COLOR_ATTACHMENT2_EXT, GL_COLOR_ATTACHMENT3_EXT
2061 double t0, t, ts, t1, t2;
2072 glDrawBuffers(3, buffers);
2078 glActiveTexture(GL_TEXTURE0);
2080 glActiveTexture(GL_TEXTURE1);
2099 glDrawBuffer(GL_COLOR_ATTACHMENT0_EXT);
2120 glActiveTexture(GL_TEXTURE0);
2122 glActiveTexture(GL_TEXTURE1);
2124 glActiveTexture(GL_TEXTURE2);
2128 glActiveTexture(GL_TEXTURE3);
2136 std::cout<<(
CLOCK()-t)<<
"\t";
2142 std::cout<<
"|\t"<<(
CLOCK()-t0)<<
"\n";
2152 std::cout <<
"<Gradient, DOG >\t"<<(t1-ts)<<
"\n"
2153 <<
"<Get Keypoints >\t"<<(t2-t1)<<
"\n";
2165 float fcount = 0.0f;
2176 glActiveTexture(GL_TEXTURE0);
2190 for(
int k = 0; k <hist_level_num - i-1 - hist_skip_gpu; k++, htex--)
2194 (htex+1)->BindTex();
2199 if(hist_skip_gpu == 0)
2203 glReadPixels(0, 0, 1, 1, GL_RGBA , GL_FLOAT, fn);
2204 fcount = (fn[0] + fn[1] + fn[2] + fn[3]);
2205 if(fcount < 1) fcount = 0;
2214 if(fcount < 1.0)
return;;
2228 glClear(GL_COLOR_BUFFER_BIT);
2249 glReadPixels(0, 0, tw, th, GL_RGBA , GL_FLOAT,
_histo_buffer);
2251 for(
int y = 0, pos = 0; y < th; y++)
2253 for(
int x= 0; x < tw; x++)
2255 for(
int c = 0; c < 4; c++, pos++)
2258 if(ss == 0)
continue;
2259 float ft[4] = {2 * x + (c%2? 1.5f: 0.5f), 2 * y + (c>=2? 1.5f: 0.5f), 0, 1 };
2260 for(
int t = 0; t < ss; t++)
2273 fcount = (float) fc;
2280 glClear(GL_COLOR_BUFFER_BIT);
2289 glActiveTexture(GL_TEXTURE0);
2296 for(
int lev = 1 + hist_skip_gpu; lev < hist_level_num - i; lev++, htex++)
2298 glActiveTexture(GL_TEXTURE0);
2301 glActiveTexture(GL_TEXTURE1);
2309 glActiveTexture(GL_TEXTURE1);
2321 glReadBuffer(GL_COLOR_ATTACHMENT0_EXT);
2322 glDrawBuffer(GL_COLOR_ATTACHMENT0_EXT);
2359 std::cout <<
"| \t" << int(ocount) <<
" :\t(" << (t2 - t1) <<
")\n";
2401 int t = ((int)
fabs(p[0])) - 1;
2403 int xx = m + m + ( (t %2)? 1 : 0);
2404 int yy = k + k + ( (t <2)? 0 : 1);
2405 if(xx ==0 || yy == 0)
continue;
2407 list.push_back(xx + 0.5f + p[1]);
2408 list.push_back(yy + 0.5f + p[2]);
2410 list.push_back(p[3]);
2414 if(fcount==0)
continue;
2428 list.resize(4*fh*fw);
2459 GLenum buffers[] = { GL_COLOR_ATTACHMENT0_EXT, GL_COLOR_ATTACHMENT1_EXT };
2460 glDrawBuffers(2, buffers);
2463 glDrawBuffer(GL_COLOR_ATTACHMENT0_EXT);
2473 if(*
count<=0)
continue;
2478 ftex->FitTexViewPort();
2480 glActiveTexture(GL_TEXTURE0);
2482 glActiveTexture(GL_TEXTURE1);
2484 glActiveTexture(GL_TEXTURE2);
2487 ftex->AttachToFBO(0);
2493 gtex->GetImgWidth(), gtex->GetImgHeight(),
2515 glDrawBuffer(GL_COLOR_ATTACHMENT0_EXT);
2524 ftex->AttachToFBO(0);
2525 ftex->FitTexViewPort();
2527 glActiveTexture(GL_TEXTURE0);
2529 glActiveTexture(GL_TEXTURE1);
2541 int wp, hp, toobig = 0;
2585 std::cout<<(toobig == 2 ?
"[**SKIP OCTAVES**]:\tExceeding Memory Cap (-nomc)\n" :
2586 "[**SKIP OCTAVES**]:\tReaching the dimension limit (-maxd)!\n");
2623 if(_octave_num < 1 || _octave_num > _octave_num_max)
2664 unsigned int totalkb = 0;
2665 int _octave_num_new, input_sz, i, j;
2679 input_sz =
min(w,h) ;
2718 for(i = 0; i< noct; i++)
2720 for( j = 0; j< nlev; j++, gus++, dog++, grd++, rot++, key++)
2724 dog->InitTexture(w, h);
2725 grd->InitTexture(w, h, 0);
2726 rot->InitTexture(w, h);
2727 if(j<=1 || j >=nlev -1)
continue;
2730 int tsz = (gus -1)->GetTexPixelCount() * 16;
2731 totalkb += ((nlev *5 -6)* tsz / 1024);
2749 delete [] _allPyramid;
2777 return _allPyramid + num *dataName +
offset;
2793 for(
int k = 0; k <hist_level_num -1; k++, htex--)
2801 w = (w + 1)>>1; h = (h + 1) >> 1;
#define FOR_EACH_OCTAVE(i, R)
#define FOR_EACH_LEVEL(j, R)
static void DeleteGlobalFBO()
static void UnattachTex(GLenum attachment)
virtual void InitTexture(int width, int height, int clamp_to_edge=1)
virtual void SetImageSize(int width, int height)
static void DetachFBO(int i)
static void DrawQuad(float x1, float x2, float y1, float y2)
virtual void ZeroHistoMargin()
void FitRealTexViewPort()
static void UnbindMultiTex(int n)
virtual void InitTexture(int width, int height, int clamp_to_edge=1)
static int _TruncateMethod
static int _octave_num_default
static int _SubpixelLocalization
static int _octave_min_default
static int _OrientationPack2
static int _DescriptorPPR
static int _FeatureCountThreshold
static int _NarrowFeatureTex
static int _ForceTightPyramid
static int _KeepExtremumSign
static float _MaxFeaturePercent
static int _DarknessAdaption
static int _MaxLevelFeatureNum
static int _NormalizedSIFT
static int _FeatureTexBlock
static int _DescriptorPPT
static int _KeyPointListForceLevel0
static int _ListGenSkipGPU
static int _MaxOrientation
static bool CheckFramebufferStatus()
static void CleanupOpenGL()
static void CheckErrorsGL(const char *location=NULL)
static void FitViewPort(int width, int height)
static void InitGLParam(int NotTargetGL=0)
void SetLevelFeatureNum(int idx, int num)
GLTexImage * _orientationTex
virtual GLTexImage * GetBaseLevel(int octave, int dataName=DATA_GAUSSIAN)=0
virtual void GetFeatureDescriptors()
virtual void DownloadKeypoints()
virtual void GenerateFeatureListTex()
virtual void ReshapeFeatureListCPU()
virtual int ResizeFeatureStorage()
virtual void DestroyPerLevelData()
GLTexImage * _histoPyramidTex
void GetAlignedStorageSize(int num, int align, int &fw, int &fh)
virtual void GenerateFeatureDisplayVBO()
virtual void CleanUpAfterSIFT()
static void InterlaceDescriptorF2(int w, int h, float *buf, float *pd, int step)
static void NormalizeDescriptor(int num, float *pd)
virtual void DestroySharedData()
void GetTextureStorageSize(int num, int &fw, int &fh)
GLTexImage * _descriptorTex
GLTexImage * GetLevelTexture(int octave, int level)
void ResizePyramid(int w, int h)
virtual void GenerateFeatureList()
GLTexImage * GetBaseLevel(int octave, int dataName=DATA_GAUSSIAN)
virtual void GetFeatureOrientations()
void GenerateFeatureListCPU()
void InitPyramid(int w, int h, int ds)
void DestroyPyramidData()
void FitHistogramPyramid()
void BuildPyramid(GLTexInput *input)
void FitPyramid(int w, int h)
PyramidNaive(SiftParam &sp)
void GetSimplifiedOrientation()
GLTexImage * GetLevelTexture(int octave, int level)
PyramidPacked(SiftParam &sp)
void FitPyramid(int w, int h)
void GenerateFeatureListCPU()
void DestroyPyramidData()
void GetFeatureOrientations()
void GetSimplifiedOrientation()
void FitHistogramPyramid()
void GenerateFeatureList()
void ResizePyramid(int w, int h)
GLTexImage * GetBaseLevel(int octave, int dataName=DATA_GAUSSIAN)
void InitPyramid(int w, int h, int ds)
void BuildPyramid(GLTexInput *input)
FilterProgram ** f_gaussian_step
static void UseShaderGenListHisto()
static void UseShaderGenListEnd(int ktex)
static void FilterSampledImage(GLTexImage *tex, GLTexImage *buf)
static void FilterInitialImage(GLTexImage *tex, GLTexImage *buf)
static void UseShaderGenListStart(float fw, int tex0)
static void UseShaderCopyKeypoint()
static void InitShaderMan(SiftParam ¶m)
static void FilterImage(FilterProgram *filter, GLTexImage *dst, GLTexImage *src, GLTexImage *tmp)
static void DestroyShaders()
static void UnloadProgram()
static void UseShaderGenListInit(int w, int h, int tight=1)
static void UseShaderKeypoint(int texU, int texD)
static void UseShaderGenVBO(float width, float fwidth, float size)
static void TextureUpSample(GLTexImage *dst, GLTexImage *src, int scale)
static void SelectInitialSmoothingFilter(int octave_min, SiftParam ¶m)
static void UseShaderDescriptor(int gtex, int otex, int dwidth, int fwidth, int width, int height, float sigma)
static void UseShaderGradientPass(int texP=0)
static void TextureDownSample(GLTexImage *dst, GLTexImage *src, int scale=2)
static void UseShaderOrientation(int gtex, int width, int height, float sigma, int auxtex, float step, int keypoint_list)
static void UseShaderSimpleOrientation(int oTex, float sigma, float sigma_step)
static void UseShaderGenListStep(int tex, int tex0)
float GetLevelSigma(int lev)
int _pyramid_octave_first
GLuint * _featurePointVBO
GLuint * _featureDisplayVBO
static int GetRequiredOctaveNum(int inputsz)
vector< int > _keypoint_index
virtual int IsUsingRectDescription()
vector< float > _descriptor_buffer
vector< float > _keypoint_buffer
__host__ __device__ float2 fabs(float2 v)
QTextStream & endl(QTextStream &stream)
MiniVec< float, N > ceil(const MiniVec< float, N > &a)