@@ -103,7 +103,6 @@ void build_histogram(const double *magnitude, const double *orientation, int nro
103
103
const int n_cells_y = nrows / rows_per_cell;
104
104
const int n_cells_x = ncols / cols_per_cell;
105
105
memset (hist, 0 , n_cells_x * n_cells_y * n_bins * sizeof (double ));
106
- constexpr bool interp = false ;
107
106
108
107
for (int y = 0 ; y < ncols; ++y) {
109
108
const int y_cell = y / rows_per_cell;
@@ -114,23 +113,18 @@ void build_histogram(const double *magnitude, const double *orientation, int nro
114
113
115
114
const double angle = orientation[y * ncols + x];
116
115
const double mag = magnitude[y * ncols + x];
117
- if (interp) {
118
- int high_bin = angle + 0.5 ;
119
- int low_bin = high_bin - 1 ;
120
-
121
- const double low_vote = mag * (high_bin + 0.5 - angle);
122
- const double high_vote = mag - low_vote;
123
- if (high_bin < 1 )
124
- low_bin = n_bins - 1 ;
125
- if (high_bin >= n_bins)
126
- high_bin = 0 ;
127
-
128
- hist[hist_offset + low_bin] += low_vote;
129
- hist[hist_offset + high_bin] += high_vote;
130
- } else {
131
- int bin = angle;
132
- hist[hist_offset + bin] += mag;
133
- }
116
+ int high_bin = angle + 0.5 ;
117
+ int low_bin = high_bin - 1 ;
118
+
119
+ const double low_vote = mag * (high_bin + 0.5 - angle);
120
+ const double high_vote = mag - low_vote;
121
+ if (high_bin < 1 )
122
+ low_bin = n_bins - 1 ;
123
+ if (high_bin >= n_bins)
124
+ high_bin = 0 ;
125
+
126
+ hist[hist_offset + low_bin] += low_vote;
127
+ hist[hist_offset + high_bin] += high_vote;
134
128
}
135
129
}
136
130
}
0 commit comments