Scyllarus: C++ Hyperspectral Processing Library
Hyperspectral Image Processing Pipeline
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Pages
nurbs.h
Go to the documentation of this file.
1 /****************************************************************************************
2  * SCYLLARUS : C++ HYPERSPECTRAL PROCESSING LIBRARY
3  * nurbs.h - Non-Uniform Rational B-Spline curves for representing Hyperspectral Images
4  *
5  * This computer code is subject to copyright:
6  * (c) National ICT Australia Limited (NICTA) 2013-2014 All Rights Reserved.
7  *
8  * Jeremy Oorloff, National ICT Australia (NICTA)
9  *
10  ***************************************************************************************/
11 
12 #ifndef NURBS_H_
13 #define NURBS_H_
14 
15 #include <armadillo>
16 #include <iso646.h>
17 #include "logger.h"
18 
19 namespace scyl
20 {
21 
22  void generate_nurbs(const arma::fcube & I,
23  const arma::fvec & wavelengths,
24  arma::fvec & knot_vector,
25  arma::fcube & control_points,
26  arma::fvec & wavelength_cp,
27  int degree=2,
28  int knot_threshold=-1,
29  float alpha=0.1f,
30  int iterations=10,
31  int debug=0);
32 
33  void nurbs_global_interpolation(const arma::fcube & I,
34  const arma::fvec & wavelengths,
35  arma::fvec & knot_vector,
36  arma::fvec & parametric_points,
37  arma::fcube & control_points,
38  arma::fvec & wavelength_cp,
39  int degree=2,
40  int debug=0);
41 
42  int nurbs_find_span(const arma::fvec & knot_vector,
43  int degree,
44  float point);
45 
46  arma::fvec nurbs_get_basis(const arma::fvec & knot_vector,
47  int span,
48  int degree,
49  float point);
50 
51  arma::fvec nurbs_minimal_knots(const arma::fcube & I,
52  const arma::fvec & wavelengths,
53  const arma::fvec & knot_vector,
54  const arma::fcube & control_points,
55  const arma::fvec & wavelength_cp,
56  arma::fvec & min_knot_vector,
57  arma::fcube & min_control_points,
58  arma::fvec & min_wavelength_cp,
59  float alpha,
60  int degree,
61  int target_knot_num,
62  int debug);
63 
64  int nurbs_remove_curve_knot(const arma::fvec & knot_vector,
65  const arma::fcube & control_points,
66  const arma::fvec & wavelength_cp,
67  arma::fvec & new_knot_vector,
68  arma::fcube & new_control_points,
69  arma::fvec & new_wavelength_cp,
70  float tolerance,
71  int degree,
72  int index,
73  int multiplicity,
74  int num_removes);
75 
76  arma::fvec nurbs_find_parapoints(const arma::fvec & wavelengths,
77  const arma::fvec & knot_vector,
78  const arma::fvec & control_points,
79  float error_tolerance,
80  int degree);
81 
82  arma::fvec nurbs_evaluate_univariate(const arma::fvec & knot_vector,
83  const arma::fvec & control_points,
84  const arma::fvec & parameters,
85  int degree);
86 
87  arma::fcube nurbs_reconstruct_curve(const arma::fvec & knot_vector,
88  const arma::fvec & t,
89  const arma::fcube & control_points,
90  const arma::fvec & wavelength_cp,
91  arma::fvec & wavelengths,
92  int degree);
93 
94  arma::fcube nurbs_reconstruct_image(const arma::fvec & knot_vector,
95  const arma::fcube & control_points,
96  const arma::fvec & wavelength_cp,
97  const arma::fvec & wavelengths,
98  arma::fvec & wavelengths_new,
99  int degree);
100 
101 }
102 
103 #endif /* NURBS_H_ */
int nurbs_find_span(const arma::fvec &knot_vector, int degree, float point)
nurbs_find_span finds the span of 'point' in the vector 'knot_vector'.
Definition: nurbs.cpp:303
arma::fcube nurbs_reconstruct_image(const arma::fvec &knot_vector, const arma::fcube &control_points, const arma::fvec &wavelength_cp, const arma::fvec &wavelengths, arma::fvec &wavelengths_new, int degree)
nurbs_reconstruct_image() takes a NURBS encoded image and returns the reconstructed image cube...
Definition: nurbs.cpp:949
int nurbs_remove_curve_knot(const arma::fvec &knot_vector, const arma::fcube &control_points, const arma::fvec &wavelength_cp, arma::fvec &new_knot_vector, arma::fcube &new_control_points, arma::fvec &new_wavelength_cp, float tolerance, int degree, int index, int multiplicity, int num_removes)
nurbs_remove_curve_knot() takes a NURBS encoded data set and a specified knot index, and attempts to remove the knot from the set.
Definition: nurbs.cpp:580
I.
Definition: scyllarus_types.h:114
void generate_nurbs(const arma::fcube &I, const arma::fvec &wavelengths, arma::fvec &knot_vector, arma::fcube &control_points, arma::fvec &wavelength_cp, int degree=2, int knot_threshold=-1, float alpha=0.1f, int iterations=10, int debug=0)
generate_nurbs() encodes an array of discrete data into a NURBS curve representation.
Definition: nurbs.cpp:39
arma::fvec nurbs_get_basis(const arma::fvec &knot_vector, int span, int degree, float point)
nurbs_get_basis() finds the basis of the sub-vector of 'knot_vector' for the given point and span...
Definition: nurbs.cpp:344
arma::fvec nurbs_minimal_knots(const arma::fcube &I, const arma::fvec &wavelengths, const arma::fvec &knot_vector, const arma::fcube &control_points, const arma::fvec &wavelength_cp, arma::fvec &min_knot_vector, arma::fcube &min_control_points, arma::fvec &min_wavelength_cp, float alpha, int degree, int target_knot_num, int debug)
nurbs_minimal_knots() takes a set of NURBS curves, and returns a minimised NURBS representation of th...
Definition: nurbs.cpp:396
void nurbs_global_interpolation(const arma::fcube &I, const arma::fvec &wavelengths, arma::fvec &knot_vector, arma::fvec &parametric_points, arma::fcube &control_points, arma::fvec &wavelength_cp, int degree=2, int debug=0)
nurbs_global_interpolation() gives an equivalent NURBS encoding for data based on the given image and...
Definition: nurbs.cpp:187
arma::fvec nurbs_find_parapoints(const arma::fvec &wavelengths, const arma::fvec &knot_vector, const arma::fvec &control_points, float error_tolerance, int degree)
nurbs_find_parapoints() calculates the parametric points for the given NURBS set. ...
Definition: nurbs.cpp:737
arma::fcube nurbs_reconstruct_curve(const arma::fvec &knot_vector, const arma::fvec &t, const arma::fcube &control_points, const arma::fvec &wavelength_cp, arma::fvec &wavelengths, int degree)
nurbs_reconstruct_curve() takes a NURBS representation of a data set and a set of points to evaluate ...
Definition: nurbs.cpp:878
arma::fvec nurbs_evaluate_univariate(const arma::fvec &knot_vector, const arma::fvec &control_points, const arma::fvec &parameters, int degree)
nurbs_evaluate_univariate() evaluates a B-Spline curve according to the given parameters.
Definition: nurbs.cpp:840