- Timestamp:
- Oct 15, 2009, 4:58:42 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/pap/psModules/src/imcombine/pmSubtractionEquation.c
r25858 r25860 379 379 380 380 // Add in penalty term to least-squares vector 381 static bool calculatePenalty(psVector *vector, // Vector to which to add in penalty term 382 const pmSubtractionKernels *kernels // Kernel parameters 381 static bool calculatePenalty(psImage *matrix, // Matrix to which to add in penalty term 382 psVector *vector, // Vector to which to add in penalty term 383 const pmSubtractionKernels *kernels, // Kernel parameters 384 float norm // Normalisation 383 385 ) 384 386 { … … 393 395 for (int yOrder = 0, index = i; yOrder <= spatialOrder; yOrder++) { 394 396 for (int xOrder = 0; xOrder <= spatialOrder - yOrder; xOrder++, index += numKernels) { 395 vector->data.F64[index] -=penalties->data.F32[i];397 matrix->data.F64[index][index] -= norm * penalties->data.F32[i]; 396 398 } 397 399 } … … 786 788 #endif 787 789 788 calculatePenalty(sumVector, kernels); 790 int bgIndex = PM_SUBTRACTION_INDEX_BG(kernels); // Index for background 791 calculatePenalty(sumMatrix, sumVector, kernels, sumMatrix->data.F64[bgIndex][bgIndex]); 789 792 790 793 #ifdef TESTING … … 870 873 } 871 874 } 872 calculatePenalty(sumVector1, kernels); 873 calculatePenalty(sumVector2, kernels); 875 876 int bgIndex = PM_SUBTRACTION_INDEX_BG(kernels); // Index for background 877 calculatePenalty(sumMatrix1, sumVector1, kernels, sumMatrix1->data.F64[bgIndex][bgIndex]); 878 calculatePenalty(sumMatrix2, sumVector2, kernels, -sumMatrix1->data.F64[bgIndex][bgIndex]); 874 879 875 880 // Pure matrix operations
Note:
See TracChangeset
for help on using the changeset viewer.
