Changeset 24293 for trunk/psModules/src/imcombine/pmSubtractionEquation.c
- Timestamp:
- Jun 1, 2009, 4:15:53 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/imcombine/pmSubtractionEquation.c
r24093 r24293 16 16 17 17 //#define TESTING 18 19 #define USE_VARIANCE // Include variance in equation? 18 20 19 21 ////////////////////////////////////////////////////////////////////////////////////////////////////////////// … … 31 33 for (int y = - footprint; y <= footprint; y++) { 32 34 for (int x = - footprint; x <= footprint; x++) { 33 sum += image1->kernel[y][x] * image2->kernel[y][x] / 1.0; // variance->kernel[y][x]; 35 double value = image1->kernel[y][x] * image2->kernel[y][x]; 36 #ifdef USE_VARIANCE 37 value /= variance->kernel[y][x]; 38 #endif 39 sum += value; 34 40 } 35 41 } … … 195 201 for (int y = - footprint; y <= footprint; y++) { 196 202 for (int x = - footprint; x <= footprint; x++) { 197 sumC += conv->kernel[y][x] / 1.0; // variance->kernel[y][x]; 203 double value = conv->kernel[y][x]; 204 #ifdef USE_VARIANCE 205 value /= variance->kernel[y][x]; 206 #endif 207 sumC += value; 198 208 } 199 209 } … … 218 228 for (int y = - footprint; y <= footprint; y++) { 219 229 for (int x = - footprint; x <= footprint; x++) { 220 double invNoise2 = 1.0 / 1.0; // variance->kernel[y][x]; 230 double invNoise2 = 1.0; 231 #ifdef USE_VARIANCE 232 invNoise2 /= variance->kernel[y][x]; 233 #endif 221 234 double value = input->kernel[y][x] * invNoise2; 222 235 sumI += value; … … 277 290 for (int y = - footprint; y <= footprint; y++) { 278 291 for (int x = - footprint; x <= footprint; x++) { 279 sumTC += target->kernel[y][x] * conv->kernel[y][x] / 1.0; // variance->kernel[y][x]; 292 double value = target->kernel[y][x] * conv->kernel[y][x]; 293 #ifdef USE_VARIANCE 294 value /= variance->kernel[y][x]; 295 #endif 296 sumTC += value; 280 297 } 281 298 } … … 297 314 for (int y = - footprint; y <= footprint; y++) { 298 315 for (int x = - footprint; x <= footprint; x++) { 299 float value = target->kernel[y][x] / 1.0; // variance->kernel[y][x]; 316 double value = target->kernel[y][x]; 317 #ifdef USE_VARIANCE 318 value /= variance->kernel[y][x]; 319 #endif 300 320 sumIT += value * input->kernel[y][x]; 301 321 sumT += value; … … 366 386 for (int y = - footprint; y <= footprint; y++) { 367 387 for (int x = - footprint; x <= footprint; x++) { 368 sumC += conv->kernel[y][x] / 1.0; // variance->kernel[y][x]; 388 double value = conv->kernel[y][x]; 389 #ifdef USE_VARIANCE 390 value /= variance->kernel[y][x]; 391 #endif 392 sumC += value; 369 393 } 370 394 }
Note:
See TracChangeset
for help on using the changeset viewer.
