Skip to content

Commit 06313cb

Browse files
griwodzCarsten Griwodz
andauthored
|debug] Add output for intermediate images during Gaussian pyramid building
* [debug] adding 3 tiny test images * [debug] write pyramid images after horizontal sweeps --------- Co-authored-by: Carsten Griwodz <[email protected]>
1 parent 034a339 commit 06313cb

File tree

4 files changed

+76
-0
lines changed

4 files changed

+76
-0
lines changed

src/popsift/sift_octave.cu

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,10 @@ void Octave::download_and_save_array( const char* basename, int octave )
120120
mkdir("dir-octave", 0700);
121121
}
122122

123+
if (stat("dir-interm", &st) == -1) {
124+
mkdir("dir-interm", 0700);
125+
}
126+
123127
if (stat("dir-octave-dump", &st) == -1) {
124128
mkdir("dir-octave-dump", 0700);
125129
}
@@ -160,6 +164,22 @@ void Octave::download_and_save_array( const char* basename, int octave )
160164
popsift::dump_plane2Dfloat(ostr2.str().c_str(), false, p );
161165
}
162166

167+
memset( &s, 0, sizeof(cudaMemcpy3DParms) );
168+
s.srcArray = _intm;
169+
s.dstPtr = make_cudaPitchedPtr( array, width * sizeof(float), width, height );
170+
s.extent = make_cudaExtent( width, height, _levels );
171+
s.kind = cudaMemcpyDeviceToHost;
172+
err = cudaMemcpy3D(&s);
173+
POP_CUDA_FATAL_TEST(err, "cudaMemcpy3D failed: ");
174+
175+
for( int l = 0; l<_levels; l++ ) {
176+
Plane2D_float p(width, height, &array[l*width*height], width * sizeof(float));
177+
178+
ostringstream ostr;
179+
ostr << "dir-interm/" << basename << "-o-" << octave << "-l-" << l << ".pgm";
180+
popsift::write_plane2Dunscaled( ostr.str().c_str(), false, p );
181+
}
182+
163183
memset( &s, 0, sizeof(cudaMemcpy3DParms) );
164184
s.srcArray = _dog_3d;
165185
s.dstPtr = make_cudaPitchedPtr(array, width * sizeof(float), width, height);

testImages/box-12x12.pgm

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
P2
2+
12 12
3+
255
4+
0 0 0 0 0 0 0 0 0 0 0 0
5+
0 0 0 0 0 0 0 0 0 0 0 0
6+
0 0 0 0 0 0 0 0 0 0 0 0
7+
0 0 0 0 0 0 0 0 0 0 0 0
8+
0 0 0 0 255 255 255 255 0 0 0 0
9+
0 0 0 0 255 0 0 255 0 0 0 0
10+
0 0 0 0 255 0 0 255 0 0 0 0
11+
0 0 0 0 255 255 255 255 0 0 0 0
12+
0 0 0 0 0 0 0 0 0 0 0 0
13+
0 0 0 0 0 0 0 0 0 0 0 0
14+
0 0 0 0 0 0 0 0 0 0 0 0
15+
0 0 0 0 0 0 0 0 0 0 0 0

testImages/box-6x6.pgm

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
P2
2+
6 6
3+
255
4+
0 0 0 0 0 0
5+
0 0 255 255 255 0
6+
0 0 255 0 255 0
7+
0 0 255 255 255 0
8+
0 0 0 0 0 0
9+
0 0 0 0 0 0

testImages/input-in-bytes.pgm

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
P2
2+
32 29
3+
255
4+
66 66 68 68 66 66 62 62 60 60 56 52 52 50 46 48 50 50 56 58 58 56 60 64 86 106 121 129 131 133 135 137
5+
62 64 66 66 62 64 62 62 60 60 58 56 52 50 46 48 50 58 64 70 78 80 84 88 112 121 126 129 131 133 135 137
6+
62 58 62 62 62 62 62 62 62 62 56 52 52 48 44 44 44 56 78 86 78 88 98 104 118 124 126 129 131 133 137 139
7+
64 64 64 62 62 60 60 62 60 56 56 48 48 42 35 33 33 48 76 86 88 94 104 114 118 121 126 129 131 133 137 139
8+
64 64 64 64 62 62 60 62 58 56 52 46 42 42 29 17 29 46 62 70 80 90 108 120 120 126 129 131 133 135 139 143
9+
64 62 62 62 62 60 58 58 58 52 48 42 35 25 19 15 19 33 50 56 72 86 110 124 126 131 133 137 141 137 143 145
10+
64 62 60 60 60 60 58 56 56 52 46 33 31 17 5 0 7 17 27 42 58 78 106 126 126 131 135 141 141 137 143 145
11+
62 62 58 58 58 58 56 56 52 50 44 29 29 15 1 0 0 5 11 19 42 70 108 126 131 135 141 145 145 143 147 149
12+
60 60 58 56 58 56 58 60 58 52 48 33 27 13 0 0 0 0 0 5 31 70 108 121 133 137 143 145 145 149 151 151
13+
56 56 52 52 52 52 56 60 58 52 48 35 23 7 0 0 0 0 0 3 35 78 116 126 135 137 143 143 147 151 153 153
14+
56 50 50 48 50 52 52 56 56 56 50 46 40 29 21 11 7 11 27 46 70 100 121 145 137 141 141 145 147 151 153 157
15+
48 48 46 46 48 48 50 50 52 60 60 60 60 50 42 42 42 46 58 76 90 112 126 135 141 143 143 147 151 155 157 157
16+
48 50 50 48 48 46 46 46 48 64 80 80 80 80 78 78 80 88 94 106 118 129 133 137 143 145 147 151 151 157 157 157
17+
52 50 50 48 46 44 44 42 48 66 92 94 96 100 106 104 104 106 116 121 131 135 137 141 145 147 149 151 153 157 157 157
18+
48 50 48 46 46 42 40 35 46 70 92 104 108 114 114 118 118 121 131 131 129 133 135 137 141 145 151 153 157 159 157 159
19+
48 48 46 44 40 40 33 29 44 70 90 112 121 121 121 126 129 129 133 133 133 141 143 145 147 149 153 157 159 161 159 161
20+
48 48 44 35 33 29 29 23 33 64 92 112 129 131 129 129 121 129 131 135 143 147 145 147 149 151 157 159 159 161 161 161
21+
48 48 42 35 27 25 21 17 25 52 80 106 131 135 135 133 133 137 143 143 143 149 149 149 151 151 157 159 161 161 161 161
22+
44 44 42 33 29 19 15 15 25 44 66 100 121 133 135 135 133 141 145 145 145 149 151 151 157 159 159 161 163 163 163 165
23+
44 44 40 31 25 15 11 11 17 31 60 92 116 133 139 143 143 145 149 147 151 155 155 155 157 161 161 161 163 165 165 165
24+
42 42 42 27 17 11 7 5 7 19 52 80 112 133 141 149 149 149 151 155 155 157 157 159 161 163 163 163 165 165 165 167
25+
44 56 52 27 7 3 5 3 13 21 33 64 108 133 141 149 149 149 151 151 157 159 161 161 165 165 167 167 167 167 167 167
26+
52 64 56 33 17 13 15 15 15 17 31 62 106 133 143 155 149 149 157 159 157 161 163 163 165 165 165 165 169 169 169 169
27+
66 76 73 62 44 33 33 35 33 33 42 66 116 141 149 157 155 151 159 161 161 163 165 165 165 165 169 169 169 169 169 169
28+
84 92 98 94 72 60 62 62 60 62 64 88 131 155 157 159 159 159 159 161 163 165 169 169 169 169 169 169 169 169 169 169
29+
100 112 118 116 94 86 86 88 88 90 94 112 143 157 157 161 161 159 159 165 169 169 169 169 169 171 171 171 171 171 171 171
30+
114 129 133 129 126 116 114 114 114 118 121 131 145 155 159 161 161 161 161 169 169 169 171 171 171 171 171 171 171 171 171 171
31+
120 133 135 139 137 131 126 126 129 131 133 143 151 155 161 163 163 165 165 169 169 171 171 171 171 171 171 171 171 171 171 171
32+
129 135 137 141 145 145 145 147 143 141 141 149 159 161 163 165 165 169 171 171 171 173 173 173 173 173 173 173 173 173 173 173

0 commit comments

Comments
 (0)