-
Notifications
You must be signed in to change notification settings - Fork 3
/
create_dense_depthmap_image_main.c
86 lines (74 loc) · 1.72 KB
/
create_dense_depthmap_image_main.c
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
#include "header.h"
void create_dense_depthmap_image_main(
int *reference_rgb_image_arr,
int width,
int height,
int *sparse_depthmap_image_arr,
int *sparse_depthmap_alpha_arr,
int *dense_depthmap_image_arr,
int gimp_path_nbr,
gimp_path_struct *gimp_path_arr,
int *diffusion_direction_image_arr,
int *diffusion_direction_alpha_arr,
double *dense_diffusion_direction_theta_image_arr,
int *edge_image_arr,
int *edge_alpha_arr
)
{
int *sparse_depthmap_rgb_image_arr;
int i;
int j;
int pixel;
int cind;
int err_flag;
add_gimp_paths_to_sparse_depthmap_image(
width,
height,
sparse_depthmap_image_arr,
sparse_depthmap_alpha_arr,
gimp_path_nbr,
gimp_path_arr
);
sparse_depthmap_rgb_image_arr= (int *)calloc(width*height,3*sizeof(int));
for ( i= 0 ; i< height ; i++ ) {
for ( j= 0 ; j< width ; j++ ) {
pixel= i*width+j;
for ( cind= 0 ; cind< 3 ; cind++ )
sparse_depthmap_rgb_image_arr[3*pixel+cind]= sparse_depthmap_image_arr[pixel];
}
}
err_flag= write_rgba_image(
(char *)"sparse_depthmap_rgba_image_2.png",
sparse_depthmap_rgb_image_arr,
sparse_depthmap_alpha_arr,
width,
height
);
free(sparse_depthmap_rgb_image_arr);
create_dense_depthmap_image(
reference_rgb_image_arr,
width,
height,
sparse_depthmap_image_arr,
sparse_depthmap_alpha_arr,
dense_depthmap_image_arr,
diffusion_direction_image_arr,
diffusion_direction_alpha_arr,
dense_diffusion_direction_theta_image_arr,
edge_image_arr,
edge_alpha_arr
);
err_flag= write_image(
(char *)"dense_depthmap_image_2.png",
dense_depthmap_image_arr,
width,
height
);
alias_dense_depthmap_image_at_edge_image(
width,
height,
dense_depthmap_image_arr,
edge_image_arr,
edge_alpha_arr
);
}