| 367 | |
| 368 | template <class TDescriptor, class F> |
| 369 | EntryId TemplatedDatabase<TDescriptor, F>::add(const std::vector<TDescriptor>& features, |
| 370 | BowVector* bowvec, |
| 371 | FeatureVector* fvec) { |
| 372 | BowVector aux; |
| 373 | BowVector& v = (bowvec ? *bowvec : aux); |
| 374 | |
| 375 | if (m_use_di && fvec != NULL) { |
| 376 | m_voc->transform(features, v, *fvec, m_dilevels); // with features |
| 377 | return add(v, *fvec); |
| 378 | } else if (m_use_di) { |
| 379 | FeatureVector fv; |
| 380 | m_voc->transform(features, v, fv, m_dilevels); // with features |
| 381 | return add(v, fv); |
| 382 | } else if (fvec != NULL) { |
| 383 | m_voc->transform(features, v, *fvec, m_dilevels); // with features |
| 384 | return add(v); |
| 385 | } else { |
| 386 | m_voc->transform(features, v); // with features |
| 387 | return add(v); |
| 388 | } |
| 389 | } |
| 390 | |
| 391 | // --------------------------------------------------------------------------- |
| 392 |
no test coverage detected