You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

80 lines
2.2 KiB

8 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. /** @file hikmeans.h
  2. ** @brief Hierarchical Integer K-Means Clustering
  3. ** @author Brian Fulkerson
  4. **/
  5. /*
  6. Copyright (C) 2007-12 Andrea Vedaldi and Brian Fulkerson.
  7. All rights reserved.
  8. This file is part of the VLFeat library and is made available under
  9. the terms of the BSD license (see the COPYING file).
  10. */
  11. #ifndef VL_HIKMEANS_H
  12. #define VL_HIKMEANS_H
  13. #include "generic.h"
  14. #include "ikmeans.h"
  15. struct _VLHIKMTree ;
  16. struct _VLHIKMNode ;
  17. /** @brief HIKM tree node
  18. **
  19. ** The number of children @a K is not bigger than the @a K parameter
  20. ** of the HIKM tree.
  21. **/
  22. typedef struct _VlHIKMNode
  23. {
  24. VlIKMFilt *filter ; /**< IKM filter for this node*/
  25. struct _VlHIKMNode **children ; /**< Node children (if any) */
  26. } VlHIKMNode ;
  27. /** @brief HIKM tree */
  28. typedef struct _VlHIKMTree {
  29. vl_size M ; /**< IKM: data dimensionality */
  30. vl_size K ; /**< IKM: K */
  31. vl_size depth ; /**< Depth of the tree */
  32. vl_size max_niters ; /**< IKM: maximum # of iterations */
  33. int method ; /**< IKM: method */
  34. int verb ; /**< Verbosity level */
  35. VlHIKMNode * root; /**< Tree root node */
  36. } VlHIKMTree ;
  37. /** @name Create and destroy
  38. ** @{
  39. **/
  40. VL_EXPORT VlHIKMTree *vl_hikm_new (int method) ;
  41. VL_EXPORT void vl_hikm_delete (VlHIKMTree *f) ;
  42. /** @} */
  43. /** @name Retrieve data and parameters
  44. ** @{
  45. **/
  46. VL_EXPORT vl_size vl_hikm_get_ndims (VlHIKMTree const *f) ;
  47. VL_EXPORT vl_size vl_hikm_get_K (VlHIKMTree const *f) ;
  48. VL_EXPORT vl_size vl_hikm_get_depth (VlHIKMTree const *f) ;
  49. VL_EXPORT int vl_hikm_get_verbosity (VlHIKMTree const *f) ;
  50. VL_EXPORT vl_size vl_hikm_get_max_niters (VlHIKMTree const *f) ;
  51. VL_EXPORT VlHIKMNode const * vl_hikm_get_root (VlHIKMTree const *f) ;
  52. /** @} */
  53. /** @name Set parameters
  54. ** @{
  55. **/
  56. VL_EXPORT void vl_hikm_set_verbosity (VlHIKMTree *f, int verb) ;
  57. VL_EXPORT void vl_hikm_set_max_niters (VlHIKMTree *f, int max_niters) ;
  58. /** @} */
  59. /** @name Process data
  60. ** @{
  61. **/
  62. VL_EXPORT void vl_hikm_init (VlHIKMTree *f, vl_size M, vl_size K, vl_size depth) ;
  63. VL_EXPORT void vl_hikm_train (VlHIKMTree *f, vl_uint8 const *data, vl_size N) ;
  64. VL_EXPORT void vl_hikm_push (VlHIKMTree *f, vl_uint32 *asgn, vl_uint8 const *data, vl_size N) ;
  65. /** @} */
  66. /* VL_HIKMEANS_H */
  67. #endif