luoyetx / JDA

C++ implementation of Joint Cascade Face Detection and Alignment.
BSD 3-Clause "New" or "Revised" License
184 stars 140 forks source link

a question about function CalcFeatureValues #35

Open xiexiexxs opened 5 years ago

xiexiexxs commented 5 years ago

Hi,thanks very much for your open source code. I've learned a lot from it.
However,i have some question with this line features[i][j] = feature.CalcFeatureValue(img, img_half, img_quarter, shape, stp_mc[i]); in function CalcFeatureValues in data.cpp LINE 168.
As I understand it, features[i][j] means the i_th feature of the j_th image, stp_mc means transformation from meanShape to currentShape. So the stp_mc used here should be stpmc[idx[j]] , am i right? Following is the original code. ` Mat DataSet::CalcFeatureValues(const vector& feature_pool, \ const vector& idx) const { const int n = feature_pool.size(); const int m = idx.size();

if (m == 0) { return Mat_(); }

Mat_ features(n, m);

pragma omp parallel for

for (int j = 0; j < m; j++) { const Mat& img = imgs[idx[j]]; const Mat& img_half = imgs_half[idx[j]]; const Mat& img_quarter = imgsquarter[idx[j]]; const Mat& shape = current_shapes[idx[j]];

for (int i = 0; i < n; i++) {
  const Feature& feature = feature_pool[i];
  features[i][j] = feature.CalcFeatureValue(img, img_half, img_quarter, shape, stp_mc[i]);
}

} return features; } `