-
Notifications
You must be signed in to change notification settings - Fork 1
/
utils.hpp
42 lines (30 loc) · 1.4 KB
/
utils.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
//===============================================================================//
// Name : utils.hpp
// Author(s) : Barbara Bruno, Antonello Scalmato
// Affiliation : University of Genova, Italy - dept. DIBRIS
// Version : 1.1
// Description : Frequently used functions (for Creator and Classifier)
//===============================================================================//
#include <armadillo>
using namespace arma;
#ifndef UTILS_HPP_
#define UTILS_HPP_
//===============================================================================//
// BASIC MATRIX-HANDLING FUNCTIONS
//! create a row-vector of the form: start:1:stop
mat createInterval(int start, int stop);
//! convert a matrix in MAT format to float format
float** matToFloat(mat &matrix);
//! convert a matrix in float format to MAT format
mat floatToMat(float** matrix, int Nrows, int Ncols);
//===============================================================================//
//===============================================================================//
// FILTERING FUNCTIONS
//! compute the median value of a vector
double median(rowvec &vector);
//! perform median filtering on a matrix
void medianFilter(mat &matrix, int size);
//! apply ChebyshevI filter on a matrix
mat ChebyshevFilter(mat matrix);
//===============================================================================//
#endif