Changeset 4035
- Timestamp:
- May 25, 2005, 1:08:33 PM (21 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/pmImageSubtract.c (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/pmImageSubtract.c
r4033 r4035 5 5 * @author GLG, MHPCC 6 6 * 7 * @version $Revision: 1. 1$ $Name: not supported by cvs2svn $8 * @date $Date: 2005-05-25 23:0 0:05$7 * @version $Revision: 1.2 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2005-05-25 23:08:33 $ 9 9 * 10 10 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 395 395 XXX: Modify loop so that terms higher than spatialOrder are not computed. 396 396 ******************************************************************************/ 397 static psImage GenSpatialOrder(psS32 spatialOrder,398 psF32 x,399 psF32 y)397 static psImage *GenSpatialOrder(psS32 spatialOrder, 398 psF32 x, 399 psF32 y) 400 400 { 401 401 psImage *polyValues = psImageAlloc(spatialOrder+1, spatialOrder+1, PS_TYPE_F64); … … 407 407 for (psS32 j = 0; j < spatialOrder + 1; j++) { 408 408 polyValues->data.F64[i][j] = ySum; 409 ySum*= imageY;410 } 411 xSum*= imageX;409 ySum*= y; 410 } 411 xSum*= x; 412 412 } 413 413 … … 458 458 459 459 // 460 // The [i][j]-th element of this structure will hold (x^i * y^j) for the stamp.461 //462 psImage *polyValues = psImageAlloc(spatialOrder+1, spatialOrder+1, PS_TYPE_F64);463 464 //465 460 // We iterate over each stamp, allocate the matrix and vectors if 466 461 // necessary, and then calculate those matrix/vectors. … … 698 693 XXX: Static structure for polyValues? 699 694 ******************************************************************************/ 700 stati s psF32 *ConvolvePixelPois(const psImage *input,701 const psImage *mask,702 psU32 badStampMaskVal,703 const psVector *solution,704 const psSubtractionKernels *kernels705 psS32 col,706 psS32 row)695 static psF32 ConvolvePixelPois(const psImage *input, 696 const psImage *mask, 697 psU32 badStampMaskVal, 698 const psVector *solution, 699 const psSubtractionKernels *kernels, 700 psS32 col, 701 psS32 row) 707 702 { 708 703 psS32 nBF = kernels->u->n; … … 711 706 psF32 background = solution->data.F64[solution->n-1]; 712 707 psS32 spatialOrder = kernels->p_spatialOrder; 708 psF32 conv = background; // Initial convolved value 713 709 714 710 if ((mask == NULL) || !(mask->data.U8[row][col] & badStampMaskVal)) { 715 psF32 conv = background; // Initial convolved value716 711 psF32 imageX = (((psF32) col) - numColsHalf) / numColsHalf; // Normalised position 717 712 psF32 imageY = (((psF32) row) - numRowsHalf) / numRowsHalf; // Normalised position … … 744 739 } 745 740 } 746 }747 psFree(polyValues);741 psFree(polyValues); 742 } 748 743 749 744 return(conv); … … 763 758 XXX: Static structure for polyValues? 764 759 ******************************************************************************/ 765 stati s psF32 *ConvolvePixelIsis(const psImage *input,766 const psImage *mask,767 psU32 badStampMaskVal,768 const psVector *solution,769 const psSubtractionKernels *kernels770 psS32 col,771 psS32 row)760 static psF32 ConvolvePixelIsis(const psImage *input, 761 const psImage *mask, 762 psU32 badStampMaskVal, 763 const psVector *solution, 764 const psSubtractionKernels *kernels, 765 psS32 col, 766 psS32 row) 772 767 { 773 768 psS32 nBF = kernels->u->n; … … 776 771 psF32 background = solution->data.F64[solution->n-1]; 777 772 psS32 spatialOrder = kernels->p_spatialOrder; 773 psS32 kernelSize = kernels->p_size; 774 psF32 conv = background; // Initial convolved value 778 775 779 776 if ((mask == NULL) || !(mask->data.U8[row][col] & badStampMaskVal)) { 780 psF32 conv = background; // Initial convolved value781 777 psF32 imageX = (((psF32) col) - numColsHalf) / numColsHalf; // Normalised position 782 778 psF32 imageY = (((psF32) row) - numRowsHalf) / numRowsHalf; // Normalised position … … 805 801 806 802 conv += solution->data.F64[k] * 807 input->data.F32[yy+ y][xx+x] *803 input->data.F32[yy+row][xx+col] * 808 804 preCalc->data.F32[yy-kernelSize][xx-kernelSize] * 809 805 polyVal; … … 811 807 } 812 808 } 813 }814 psFree(polyValues);809 psFree(polyValues); 810 } 815 811 816 812 return(conv); 817 813 } 818 819 820 821 822 823 814 824 815 /******************************************************************************* … … 1144 1135 // the psImage polyValues will hold (x^i * y^j) for the stamp. 1145 1136 // 1146 psImage *polyValues = GenSpatialOrder( psS32spatialOrder, x, y);1137 psImage *polyValues = GenSpatialOrder(spatialOrder, x, y); 1147 1138 1148 1139 for (psS32 k = 0 ; k < nBF ; k++) {
Note:
See TracChangeset
for help on using the changeset viewer.
