-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLinearSystem.h
70 lines (54 loc) · 1.55 KB
/
LinearSystem.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
68
69
70
// LinearSystem.h: interface for the LinearSystem class.
//
//////////////////////////////////////////////////////////////////////
#ifndef LINEARSYSTEM_H
#define LINEARSYSTEM_H
#include "RGBImage.h"
enum Basis_e {QUADRATIC_BIVARIATE, QUADRATIC_UNIVARIATE};
#define STRSIZE 256
class LinearSystem
{
public:
LinearSystem(Basis_e b, bool c = false,
int crop_left = 0, int crop_top = 0,
int crop_width = 1000, int crop_height = 1000);
int FitPTM(char *lpfile);
virtual ~LinearSystem();
void WriteFileVersion1_2(char *filename);
private:
int InitFiles(char *lpfile);
int LoadFiles();
int BuildMatrix(double ** &M);
int ComputePolynomials(double **M);
void ComputeScaleAndBias();
void ComputeQuantizedRGBPolynomials();
void ComputeQuantizedLumPolynomials();
int Images_m; // number of images read in
RGB_Image *Samples_m; // pointer to actual input images also contains the position
// should be in 3D though.
Basis_e basis_m;
// keep a mem cache
bool cache;
// only work on this part of the input images
// crop expressed as 10 x percent
int crop_left_m;
int crop_top_m;
int crop_width_m;
int crop_height_m;
// inverse matrix, as passed to compute_polys()
vips::VImage vipsM;
// huge array of computed coefficients
vips::VImage coeffs;
double scale[6];
int bias[6];
RGB_Image *qredhigh ;
RGB_Image *qredlow;
RGB_Image *qgreenhigh;
RGB_Image *qgreenlow;
RGB_Image *qbluehigh;
RGB_Image *qbluelow;
RGB_Image *qlumlow;
RGB_Image *qlumhigh;
RGB_Image *colors;
};
#endif /*LINEARSYSTEM_H*/