- Timestamp:
- Jun 20, 2008, 3:27:33 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/pap_branch_080617/psModules/src/imcombine/pmSubtractionEquation.c
r18239 r18248 30 30 for (int y = - footprint; y <= footprint; y++) { 31 31 for (int x = - footprint; x <= footprint; x++) { 32 sum += image1->kernel[y][x] * image2->kernel[y][x] / weight->kernel[y][x];32 sum += image1->kernel[y][x] * image2->kernel[y][x] / 1.0; // weight->kernel[y][x]; 33 33 } 34 34 } … … 194 194 for (int y = - footprint; y <= footprint; y++) { 195 195 for (int x = - footprint; x <= footprint; x++) { 196 sumC += conv->kernel[y][x] / weight->kernel[y][x];196 sumC += conv->kernel[y][x] / 1.0; // weight->kernel[y][x]; 197 197 } 198 198 } … … 217 217 for (int y = - footprint; y <= footprint; y++) { 218 218 for (int x = - footprint; x <= footprint; x++) { 219 double invNoise2 = 1.0 / weight->kernel[y][x];219 double invNoise2 = 1.0 / 1.0; // weight->kernel[y][x]; 220 220 double value = input->kernel[y][x] * invNoise2; 221 221 sumI += value; … … 276 276 for (int y = - footprint; y <= footprint; y++) { 277 277 for (int x = - footprint; x <= footprint; x++) { 278 sumTC += target->kernel[y][x] * conv->kernel[y][x]/ weight->kernel[y][x];278 sumTC += target->kernel[y][x] * conv->kernel[y][x] / 1.0; // weight->kernel[y][x]; 279 279 } 280 280 } … … 296 296 for (int y = - footprint; y <= footprint; y++) { 297 297 for (int x = - footprint; x <= footprint; x++) { 298 float value = target->kernel[y][x] / weight->kernel[y][x];298 float value = target->kernel[y][x] / 1.0; // weight->kernel[y][x]; 299 299 sumIT += value * input->kernel[y][x]; 300 300 sumT += value; … … 365 365 for (int y = - footprint; y <= footprint; y++) { 366 366 for (int x = - footprint; x <= footprint; x++) { 367 sumC += conv->kernel[y][x] / weight->kernel[y][x];367 sumC += conv->kernel[y][x] / 1.0; // weight->kernel[y][x]; 368 368 } 369 369 } … … 384 384 385 385 // Add in penalty term to least-squares vector 386 static bool calculatePenalty(int numPixels, // Number of pixels; for normalisation 387 psVector *vector, // Vector to which to add in penalty term 386 static bool calculatePenalty(psVector *vector, // Vector to which to add in penalty term 388 387 const pmSubtractionKernels *kernels // Kernel parameters 389 388 ) … … 393 392 } 394 393 395 float penalty = numPixels * kernels->penalty; // Penalty value396 394 psVector *penalties = kernels->penalties; // Penalties for each kernel component 397 395 int spatialOrder = kernels->spatialOrder; // Order of spatial variations … … 400 398 for (int yOrder = 0, index = i; yOrder <= spatialOrder; yOrder++) { 401 399 for (int xOrder = 0; xOrder <= spatialOrder - yOrder; xOrder++, index += numKernels) { 402 vector->data.F64[index] -= penalt y * penalties->data.F32[i];400 vector->data.F64[index] -= penalties->data.F32[i]; 403 401 } 404 402 } … … 711 709 } 712 710 } 713 calculatePenalty( numStamps * PS_SQR(2 * stamps->footprint + 1),sumVector, kernels);711 calculatePenalty(sumVector, kernels); 714 712 715 713 psVector *permutation = NULL; // Permutation vector, required for LU decomposition … … 758 756 } 759 757 } 760 calculatePenalty( numStamps * PS_SQR(2 * stamps->footprint + 1),sumVector1, kernels);761 calculatePenalty( numStamps * PS_SQR(2 * stamps->footprint + 1),sumVector2, kernels);758 calculatePenalty(sumVector1, kernels); 759 calculatePenalty(sumVector2, kernels); 762 760 763 761 #if 0 … … 812 810 psImage *F = (psImage*)psBinaryOp(NULL, CtBiC, "-", A); 813 811 assert(F->numRows == numParams && F->numCols == numParams); 814 float det = NAN;812 float det = 0.0; 815 813 psImage *Fi = psMatrixInvert(NULL, F, &det); 816 814 assert(Fi->numRows == numParams && Fi->numCols == numParams);
Note:
See TracChangeset
for help on using the changeset viewer.
