質問編集履歴

1

転記ソースの誤りがあったため、修正

2018/02/07 07:55

投稿

ojioji
ojioji

スコア11

test CHANGED
File without changes
test CHANGED
@@ -16,17 +16,47 @@
16
16
 
17
17
 
18
18
 
19
+ ```
20
+
19
21
  int width = 画像サイズ(幅);
20
22
 
21
23
  int hight = 画像サイズ(高さ);
22
24
 
23
- intfilecount = ファイル件数;
25
+ int filecount = ファイル件数;
24
26
 
25
- float ***buf = NULL
27
+ float *tmp = NULL;
26
28
 
29
+ float ***tmp2 = NULL
30
+
27
- FILE *fp;
31
+ FILE *fp;
28
32
 
29
33
  char fpath = イメージ画像のパス
34
+
35
+ unsigned short int buf;
36
+
37
+
38
+
39
+ //tmp 用メモリの確保
40
+
41
+ tmp = (float*)calloc( width * hight, sizeof( float ) );
42
+
43
+
44
+
45
+ //tmp2 用メモリの確保
46
+
47
+ (*tmp2) = (float***)calloc( filecount, sizeof( float ** ) );
48
+
49
+ for( i = 0 ; i < filecount ; i++ ){
50
+
51
+ (*tmp2)[i] = (float**)calloc( lines, sizeof( float * ) );
52
+
53
+ for( j = 0 ; j < hight ; j++ ){
54
+
55
+ (*tmp2)[i][j] = (float*)calloc( width, sizeof( float ) );
56
+
57
+ }
58
+
59
+ }
30
60
 
31
61
 
32
62
 
@@ -44,7 +74,7 @@
44
74
 
45
75
  if( buf != 0 ){
46
76
 
47
- fTemp[j*width+k] = (float)( 10.0 * log10( (double)(buf*buf) ) - 83.0 );
77
+ tmp[j*width+k] = (float)( 10.0 * log10( (double)(buf*buf) ) 83.0 );
48
78
 
49
79
  }
50
80
 
@@ -52,9 +82,21 @@
52
82
 
53
83
  }
54
84
 
85
+
86
+
87
+ for( j = 0 ; j < (3/2) ; j++ ){
88
+
89
+ for( k = 0 ; k < width ; k++ ){
90
+
91
+ (*tmp2)[i][j][k] = tmp[j*width+k];
92
+
93
+ }
94
+
95
+ }
96
+
55
97
  }
56
98
 
57
-
99
+ ```
58
100
 
59
101
 
60
102