[go: up one dir, main page]

Menu

[r9]: / trunk / cocolib / tc / tc.h  Maximize  Restore  History

Download this file

99 lines (70 with data), 2.5 kB

 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
/** \file tc.h
Solver for Total Curvature
Copyright (C) 2010 Bastian Goldluecke,
<first name>AT<last name>.net
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __COCO_TC_H
#define __COCO_TC_H
#include "../defs.h"
#include <vector>
#include <gsl/gsl_matrix.h>
#define stcflt cuflt
namespace coco {
// Workspace structure
struct tc_workspace;
// Helper structure to set all parameters
struct tc_data
{
// Problem dimension
size_t _W;
size_t _H;
// Curvature window
size_t _N;
// Current iteration
size_t _iteration;
// Curvature weight
stcflt _alpha;
// Curvature exponent
stcflt _p;
// Data term weight
stcflt _lambda;
// TV weight
stcflt _tv_lambda;
// Number of inner iterations
size_t _inner_iterations;
// Local workspace data
tc_workspace* _workspace;
};
/*****************************************************************************
Workspace creation / access
*****************************************************************************/
// Alloc PDE data with sensible defaults
tc_data* tc_data_alloc( size_t N, gsl_matrix *a );
// Free up PDE data
bool tc_data_free( tc_data *data );
// Initialize workspace with current solution
bool tc_initialize( tc_data *data,
gsl_matrix* u );
// Set mask for inpainting model
bool tc_set_inpainting_mask( tc_data *data, gsl_matrix *mask );
// Set kernels for deblurring
bool tc_set_kernel( tc_data *data, gsl_matrix *kernel );
bool tc_set_separable_kernel( tc_data *data, gsl_vector *kernel );
// Get current solution
bool tc_get_solution( tc_data *data,
gsl_matrix* u );
// Init product field from single layer
bool tc_init_product_field( tc_data *data,
std::vector<stcflt*> &v, stcflt *u );
}
#endif