Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update FerNNClassifier.cpp #19

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

kotchin
Copy link

@kotchin kotchin commented Mar 8, 2014

The proposed change is to the function called FerNNClassifier::getFeatures().
Originally, the function was :

for (int t=0;t<nstructs;t++){
leaf=0;
for (int f=0; f<structSize; f++){
leaf = (leaf << 1) + features[scale_idx]t*nstructs+f;
}
fern[t]=leaf;
}

With nstructs = 10 and structSize = 13.

The issue comes from the indexes in the features function where leaf is updated. They are in reverse order. This means that not all features from 0 to 129 are used, instead only features from 0 to t_nstructs+f = 9_10 + 13 = 103 are used. We still have 130 bits in the leaf variable because some are used several times. So the algorithm relies on 104 features instead of the intended 130 which decreases the performance of it.
This correction increases the tracking performance significantly without having any impact on required processing power since the extra features we are now using are already calculated, just not used until now.

I hope I was able to improve the project.

Sincerely,
Alex

The proposed change is to the function called FerNNClassifier::getFeatures().
Originally, the function was :

  for (int t=0;t<nstructs;t++){
    leaf=0;
    for (int f=0; f<structSize; f++){
      leaf = (leaf << 1) + features[scale_idx][t*nstructs+f](image);
    }
    fern[t]=leaf;
  }

With nstructs = 10 and structSize = 13.

The issue comes from the indexes in the features function where leaf is updated. They are in reverse order. This means that not all features from 0 to 129 are used, instead only features from 0 to t*nstructs+f = 9*10 + 13 = 103 are used. We still have 130 bits in the leaf variable because some are used several times. So the algorithm relies on 104 features instead of the intended 130 which decreases the performance of it.
This correction increases the tracking performance significantly without having any impact on required processing power since the extra features we are now using are already calculated, just not used until now. 

I hope I was able to improve the project. 

Sincerely,
Alex
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant