Debian Codegraph @

src/thirdparty/VLFeat/hog.h

raw
1 /** @file hog.h
2 ** @brief Histogram of Oriented Gradients (@ref hog)
3 ** @author Andrea Vedaldi
4 **/
5
6 /*
7 Copyright (C) 2007-12 Andrea Vedaldi and Brian Fulkerson.
8 All rights reserved.
9
10 This file is part of the VLFeat library and is made available under
11 the terms of the BSD license (see the COPYING file).
12 */
13
14 #ifndef VL_HOG_H
15 #define VL_HOG_H
16
17 #include "generic.h"
18
19 enum VlHogVariant_ { VlHogVariantDalalTriggs, VlHogVariantUoctti } ;
20
21 typedef enum VlHogVariant_ VlHogVariant ;
22
23 struct VlHog_
24 {
25 VlHogVariant variant ;
26 vl_size dimension ;
27 vl_size numOrientations ;
28 vl_bool transposed ;
29 vl_bool useBilinearOrientationAssigment ;
30
31 /* left-right flip permutation */
32 vl_index * permutation ;
33
34 /* glyphs */
35 float * glyphs ;
36 vl_size glyphSize ;
37
38 /* helper vectors */
39 float * orientationX ;
40 float * orientationY ;
41
42 /* buffers */
43 float * hog ;
44 float * hogNorm ;
45 vl_size hogWidth ;
46 vl_size hogHeight ;
47 } ;
48
49 typedef struct VlHog_ VlHog ;
50
51 VL_EXPORT VlHog * vl_hog_new (VlHogVariant variant, vl_size numOrientations, vl_bool transposed) ;
52 VL_EXPORT void vl_hog_delete (VlHog * self) ;
53 VL_EXPORT void vl_hog_process (VlHog * self,
54 float * features,
55 float const * image,
56 vl_size width, vl_size height, vl_size numChannels,
57 vl_size cellSize) ;
58
59 VL_EXPORT void vl_hog_put_image (VlHog * self,
60 float const * image,
61 vl_size width, vl_size height, vl_size numChannels,
62 vl_size cellSize) ;
63
64 VL_EXPORT void vl_hog_put_polar_field (VlHog * self,
65 float const * modulus,
66 float const * angle,
67 vl_bool directed,
68 vl_size width, vl_size height, vl_size cellSize) ;
69
70 VL_EXPORT void vl_hog_extract (VlHog * self, float * features) ;
71 VL_EXPORT vl_size vl_hog_get_height (VlHog * self) ;
72 VL_EXPORT vl_size vl_hog_get_width (VlHog * self) ;
73
74
75 VL_EXPORT void vl_hog_render (VlHog const * self,
76 float * image,
77 float const * features,
78 vl_size width,
79 vl_size height) ;
80
81 VL_EXPORT vl_size vl_hog_get_dimension (VlHog const * self) ;
82 VL_EXPORT vl_index const * vl_hog_get_permutation (VlHog const * self) ;
83 VL_EXPORT vl_size vl_hog_get_glyph_size (VlHog const * self) ;
84
85 VL_EXPORT vl_bool vl_hog_get_use_bilinear_orientation_assignments (VlHog const * self) ;
86 VL_EXPORT void vl_hog_set_use_bilinear_orientation_assignments (VlHog * self, vl_bool x) ;
87
88 /* VL_HOG_H */
89 #endif