-
Notifications
You must be signed in to change notification settings - Fork 0
/
Zernike.h
67 lines (51 loc) · 1.66 KB
/
Zernike.h
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/*
* Zernike.h
*
* Created on: Oct 3, 2013
* Author: dailos
*/
#ifndef ZERNIKES_H_
#define ZERNIKES_H_
#include <vector>
#include <string>
#include <complex>
#include <map>
#include <cmath>
#include <ctime>
#include "opencv2/opencv.hpp"
class Zernike
{
public:
Zernike(const double& r_c, const int& nph, const int& z_max = 20);
/**
* Default constructor of the Zernike class.
*/
Zernike();
/**
* Returns a square phase map given by the sum of Zernike abberations
* where the unit circle is maximized.
* @param sideLength The size in pixels of the output phase map
*/
cv::Mat phaseMapZernikeSum(const unsigned int& sideLength, const double& radiousLength, const cv::Mat& coeffs);
void analyse(const cv::Mat& sig, cv::Mat& z_coeffs);
void synthesize(const cv::Mat& z_coeffs, cv::Mat& sig);
void zernike_mn(const int& j,int &m,int &n);
double zernike_covar(int i,int j);
void polynomial(const double& r_c, const int& nph, const int& j, cv::Mat& z_j);
//Circular pupil amplitude
void circular_mask(const double& r_c, const int& nph, cv::Mat& c_mask);
void circular_mask(cv::Mat& c_mask);
/**
* Returns a phase map given by a single Zernike polynomial
*
* @param j The Zernike single index
* @param sideLength The size in pixels of the output phase map
*/
cv::Mat phaseMapZernike(const unsigned int& j, const unsigned int& sideLength, const double& radiousLength, const bool& unit_rms = true, const bool& c_mask = true);
const std::vector<cv::Mat>& base() const {return base_;};
private:
double radious_px_;
int side_px_;
std::vector<cv::Mat> base_;
};
#endif /* ZERNIKES_H_ */