Scyllarus: C++ Hyperspectral Processing Library
Hyperspectral Image Processing Pipeline
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Pages
filters.h
Go to the documentation of this file.
1 /****************************************************************************************
2  * SCYLLARUS : C++ HYPERSPECTRAL PROCESSING LIBRARY
3  * filters.h - Image processing routines for use with HS images.
4  *
5  * Copyright 2013 NICTA (Jeremy Oorloff, Keith Grochow)
6  *
7  ***************************************************************************************/
8 
9 #ifndef FILTERS_H_
10 #define FILTERS_H_
11 
12 
13 #include <armadillo>
14 #include <iso646.h>
15 #include "logger.h"
16 
17 namespace scyl
18 {
25  template<class T> inline void clip_lower(T &a, float f_lim, float f_set)
26  {
27  for (arma::uword i = 0; i < a.n_elem; i++)
28  {
29  if (a[i] <= f_lim)
30  {
31  a[i] = f_set;
32  }
33  }
34  }
35 
41  template<class T> inline void clip_lower(T& a, float f_lim)
42  {
43  clip_lower(a, f_lim, f_lim);
44  }
45 
46  arma::fmat conv(const arma::fmat & a,
47  arma::fvec kernel);
48 
49  arma::fmat conv2(const arma::fmat & a,
50  arma::fmat kernel);
51 
52  arma::fmat wiener2(const arma::fmat & a,
53  arma::fvec nhood);
54 
55  arma::fmat median(const arma::fmat & a,
56  arma::u32 iSize);
57 
58  void savitzky_golay(arma::fcube & in,
59  int window=5);
60 
61  void moving_average(arma::fcube & in,
62  int window=3);
63 }
64 
65 #endif /* FILTERS_H_ */
arma::fmat median(const arma::fmat &a, arma::u32 iSize)
Apply a median filter to an arma matrix (based on matlab implementation)
Definition: filters.cpp:55
arma::fmat conv2(const arma::fmat &a, arma::fmat kernel)
Convolve a matrix with a 2D filter kernel (based on matlab implementation)
Definition: filters.cpp:139
void savitzky_golay(arma::fcube &in, int window=5)
Definition: filters.cpp:202
arma::fmat wiener2(const arma::fmat &a, arma::fvec nhood)
Apply a de-blurring wiener filter to an arma matrix (based on matlab implementation) ...
Definition: filters.cpp:17
void clip_lower(T &a, float f_lim, float f_set)
Clip arma matrix values below a lower limit and set clipped values to an arbitrary value...
Definition: filters.h:25
arma::fmat conv(const arma::fmat &a, arma::fvec kernel)
Convolve a matrix with a 1D filter kernel (based on matlab implementation)
Definition: filters.cpp:102
void moving_average(arma::fcube &in, int window=3)
Definition: filters.cpp:271