1 /** @file scalespace.h
2  ** @brief Scale Space (@ref scalespace)
3  ** @author Andrea Vedaldi
4  ** @author Karel Lenc
5  ** @author Michal Perdoch
6  **/
7 
8 /*
9 Copyright (C) 2007-12 Andrea Vedaldi and Brian Fulkerson.
10 All rights reserved.
11 
12 This file is part of the VLFeat library and is made available under
13 the terms of the BSD license (see the COPYING file).
14 */
15 
16 #ifndef VL_SCALESPACE_H
17 #define VL_SCALESPACE_H
18 
19 #include "generic.h"
20 #include "imopv.h"
21 #include "mathop.h"
22 
23 /* ---------------------------------------------------------------- */
24 /*                                             VlScaleSpaceGeometry */
25 /* ---------------------------------------------------------------- */
26 
27 /** @brief Geometry of a scale space
28  **
29  ** There are a few restrictions on the valid geometrties.
30  */
31 typedef struct _VlScaleSpaceGeometry
32 {
33   vl_size width ; /**< Image width */
34   vl_size height ; /**< Image height */
35   vl_index firstOctave ; /**< Index of the fisrt octave */
36   vl_index lastOctave ; /**< Index of the last octave */
37   vl_size octaveResolution ; /**< Number of octave subdivisions */
38   vl_index octaveFirstSubdivision ; /**< Index of the first octave subdivision */
39   vl_index octaveLastSubdivision ; /**< Index of the last octave subdivision */
40   double baseScale ; /**< Base smoothing (smoothing of octave 0, level 0) */
41   double nominalScale ; /**< Nominal smoothing of the original image */
42 } VlScaleSpaceGeometry ;
43 
44 VL_EXPORT
45 vl_bool vl_scalespacegeometry_is_equal (VlScaleSpaceGeometry a,
46                                         VlScaleSpaceGeometry b) ;
47 
48 /* ---------------------------------------------------------------- */
49 /*                                       VlScaleSpaceOctaveGeometry */
50 /* ---------------------------------------------------------------- */
51 
52 /** @brief Geometry of one octave of a scale space */
53 typedef struct _VlScaleSpaceOctaveGeometry
54 {
55   vl_size width ; /**< Width (number of pixels) */
56   vl_size height ; /**< Height (number of pixels) */
57   double step ; /**< Sampling step (size of a pixel) */
58 } VlScaleSpaceOctaveGeometry ;
59 
60 /* ---------------------------------------------------------------- */
61 /*                                                     VlScaleSpace */
62 /* ---------------------------------------------------------------- */
63 
64 typedef struct _VlScaleSpace VlScaleSpace ;
65 
66 /** @name Create and destroy
67  ** @{
68  **/
69 VL_EXPORT VlScaleSpaceGeometry vl_scalespace_get_default_geometry(vl_size width, vl_size height) ;
70 VL_EXPORT VlScaleSpace * vl_scalespace_new (vl_size width, vl_size height) ;
71 VL_EXPORT VlScaleSpace * vl_scalespace_new_with_geometry (VlScaleSpaceGeometry geom) ;
72 VL_EXPORT VlScaleSpace * vl_scalespace_new_copy (VlScaleSpace* src);
73 VL_EXPORT VlScaleSpace * vl_scalespace_new_shallow_copy (VlScaleSpace* src);
74 VL_EXPORT void vl_scalespace_delete (VlScaleSpace *self) ;
75 /** @} */
76 
77 /** @name Process data
78  ** @{
79  **/
80 VL_EXPORT void
81 vl_scalespace_put_image (VlScaleSpace *self, float const* image);
82 /** @} */
83 
84 /** @name Retrieve data and parameters
85  ** @{
86  **/
87 VL_EXPORT VlScaleSpaceGeometry vl_scalespace_get_geometry (VlScaleSpace const * self) ;
88 VL_EXPORT VlScaleSpaceOctaveGeometry vl_scalespace_get_octave_geometry (VlScaleSpace const * self, vl_index o) ;
89 VL_EXPORT float *
90 vl_scalespace_get_level (VlScaleSpace * self, vl_index o, vl_index s) ;
91 VL_EXPORT float const *
92 vl_scalespace_get_level_const (VlScaleSpace const * self, vl_index o, vl_index s) ;
93 VL_EXPORT double
94 vl_scalespace_get_level_sigma (VlScaleSpace const *self, vl_index o, vl_index s) ;
95 /** @} */
96 
97 /* VL_SCALESPACE_H */
98 #endif
99 
100