Skip to content

Commit cf4f4d2

Browse files
author
Carsten Griwodz
committed
[sift] Remove dead code for extrema search in interpolated DoG planes
Extrema are searched from 3x3x3 blocks of pixels in the DoG pyramid. The dead code could search in interpolated pixels, which never made sense. The code was always #undef'ed.
1 parent a30a990 commit cf4f4d2

File tree

3 files changed

+3
-20
lines changed

3 files changed

+3
-20
lines changed

src/popsift/s_extrema.cu

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -579,17 +579,12 @@ void Pyramid::find_extrema( const Config& conf )
579579

580580
int* num_blocks = extrema_num_blocks;
581581

582-
#ifdef USE_DOG_TEX_LINEAR
583-
#define getDogTexture getDogTextureLinear
584-
#else
585-
#define getDogTexture getDogTexturePoint
586-
#endif
587582
switch( conf.getSiftMode() )
588583
{
589584
case Config::VLFeat :
590585
find_extrema_in_dog<HEIGHT,Config::VLFeat>
591586
<<<grid,block,0,oct_str>>>
592-
( oct_obj.getDogTexture( ),
587+
( oct_obj.getDogTexturePoint( ),
593588
octave,
594589
cols,
595590
rows,
@@ -604,7 +599,7 @@ void Pyramid::find_extrema( const Config& conf )
604599
case Config::OpenCV :
605600
find_extrema_in_dog<HEIGHT,Config::OpenCV>
606601
<<<grid,block,0,oct_str>>>
607-
( oct_obj.getDogTexture( ),
602+
( oct_obj.getDogTexturePoint( ),
608603
octave,
609604
cols,
610605
rows,
@@ -619,7 +614,7 @@ void Pyramid::find_extrema( const Config& conf )
619614
default :
620615
find_extrema_in_dog<HEIGHT,Config::PopSift>
621616
<<<grid,block,0,oct_str>>>
622-
( oct_obj.getDogTexture( ),
617+
( oct_obj.getDogTexturePoint( ),
623618
octave,
624619
cols,
625620
rows,
@@ -632,7 +627,6 @@ void Pyramid::find_extrema( const Config& conf )
632627
POP_SYNC_CHK;
633628
break;
634629
}
635-
#undef getDogTexture
636630

637631
cuda::event_record( oct_obj.getEventExtremaDone(), oct_str, __FILE__, __LINE__ );
638632
}

src/popsift/sift_octave.cu

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -410,19 +410,12 @@ void Octave::alloc_dog_tex()
410410

411411
err = cudaCreateTextureObject(&_dog_3d_tex_point, &dog_res_desc, &dog_tex_desc, 0);
412412
POP_CUDA_FATAL_TEST(err, "Could not create DoG texture: ");
413-
414-
dog_tex_desc.filterMode = cudaFilterModeLinear; // linear interpolation
415-
err = cudaCreateTextureObject(&_dog_3d_tex_linear.tex, &dog_res_desc, &dog_tex_desc, 0);
416-
POP_CUDA_FATAL_TEST(err, "Could not create DoG texture: ");
417413
}
418414

419415
void Octave::free_dog_tex()
420416
{
421417
cudaError_t err;
422418

423-
err = cudaDestroyTextureObject(_dog_3d_tex_linear.tex);
424-
POP_CUDA_FATAL_TEST(err, "Could not destroy DoG texture: ");
425-
426419
err = cudaDestroyTextureObject(_dog_3d_tex_point);
427420
POP_CUDA_FATAL_TEST(err, "Could not destroy DoG texture: ");
428421

src/popsift/sift_octave.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ class Octave
5353
cudaExtent _dog_3d_ext{};
5454
cudaSurfaceObject_t _dog_3d_surf{};
5555
cudaTextureObject_t _dog_3d_tex_point{};
56-
LinearTexture _dog_3d_tex_linear{};
5756

5857
// one CUDA stream per level
5958
// consider whether some of them can be removed
@@ -127,9 +126,6 @@ class Octave
127126
inline cudaTextureObject_t& getDogTexturePoint( ) {
128127
return _dog_3d_tex_point;
129128
}
130-
inline LinearTexture& getDogTextureLinear( ) {
131-
return _dog_3d_tex_linear;
132-
}
133129

134130
/**
135131
* @brief Allocates all GPU memories for one octave.

0 commit comments

Comments
 (0)