forked from tikroeger/OF_DIS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
refine_variational.h
69 lines (48 loc) · 1.9 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
62
63
64
65
66
67
#ifndef VARREF_HEADER
#define VARREF_HEADER
#include "FDF1.0.1/image.h"
#include "FDF1.0.1/opticalflow_aux.h"
#include "FDF1.0.1/solver.h"
#include "oflow.h"
namespace OFC
{
typedef __v4sf v4sf;
typedef struct
{
float alpha; // smoothness weight
float beta; // matching weight
float gamma; // gradient constancy assumption weight
float delta; // color constancy assumption weight
int n_inner_iteration; // number of inner fixed point iterations
int n_solver_iteration; // 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;
} TVparams;
class VarRefClass
{
public:
VarRefClass(const float * im_ao_in, const float * im_ao_dx_in, const float * im_ao_dy_in, // expects #sc_f_in pointers to float arrays for images and gradients.
const float * im_bo_in, const float * im_bo_dx_in, const float * im_bo_dy_in,
const camparam* cpt_in, const camparam* cpo_in,const optparam* op_in, float *flowout);
~VarRefClass();
private:
convolution_t *deriv, *deriv_flow;
#if (SELECTCHANNEL==1 | SELECTCHANNEL==2) // Intensity image, or gradient image
void copyimage(const float* img, image_t * img_t);
void RefLevelOF(image_t *wx, image_t *wy, const image_t *im1, const image_t *im2);
void RefLevelDE(image_t *wx, const image_t *im1, const image_t *im2);
#else // 3-Color RGB image
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);
void RefLevelDE(image_t *wx, const color_image_t *im1, const color_image_t *im2);
#endif
TVparams tvparams;
const camparam* cpt;
const camparam* cpo;
const optparam* op;
};
}
#endif /* VARREF_HEADER */