-
Notifications
You must be signed in to change notification settings - Fork 7
/
refine_variational.h
61 lines (42 loc) · 1.38 KB
/
refine_variational.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
#ifndef VARREF_HEADER
#define VARREF_HEADER
#include "FDF1.0.1/image.h"
#include "oflow.h"
namespace OFC {
// typedef __v4sf v4sf;
#if (VECTOR_WIDTH == 4)
typedef float32x4_t v4sf;
#else
typedef float v4sf;
#endif
typedef struct {
float alpha; // smoothness weight
float beta; // matching weight
float gamma; // gradient constancy assumption weight
float delta; // color constancy assumption weight
int inner_iter;
int solve_iter; // number of solver iterations
float sor_omega; // omega parameter of sor method
float tmp_quarter_alpha;
float tmp_half_gamma_over3;
float tmp_half_delta_over3;
float tmp_half_beta;
} VR_params;
class VarRefClass {
public:
VarRefClass(const float * _I0, const float * _I1,
const img_params* _i_params, const opt_params* _op, float *flowout);
~VarRefClass();
private:
convolution_t *deriv, *deriv_flow;
void copyimage(const float* img, color_image_t * img_t);
void RefLevelOF(image_t *wx, image_t *wy, const color_image_t *im1, const color_image_t *im2);
VR_params vr;
const img_params* i_params;
const opt_params* op;
float *pDeviceColorDerivativeKernel;
float *pDeviceDerivativeKernel;
float *pDeviceSubLaplacianCoeffs;
};
}
#endif /* VARREF_HEADER */