- Timestamp:
- Nov 8, 2007, 12:59:04 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branch_20071023/psModules/src/imcombine/pmStackReject.c
r14701 r15516 52 52 53 53 // Convolve the image with the kernel --- we're basically applying a matched filter and then thresholding 54 psImage *convolved = NULL; // Convolved image 54 pmReadout *convRO = pmReadoutAlloc(NULL); // Readout with convolved image 55 pmReadout *inRO = pmReadoutAlloc(NULL); // Readout with input image 56 inRO->image = image; 55 57 for (int i = 0; i < numRegions; i++) { 56 58 psRegion *region = regions->data[i]; // Region of interest 57 59 psVector *solution = solutions->data[i]; // Solution of interest 58 if (!pmSubtractionConvolve( &convolved, NULL, NULL, image, NULL, NULL, 0,59 region, solution, kernels, true)) {60 if (!pmSubtractionConvolve(convRO, inRO, NULL, NULL, 0, region, solution, kernels, 61 PM_SUBTRACTION_MODE_1, true)) { 60 62 psError(PS_ERR_UNKNOWN, false, "Unable to convolve mask image in region %d.", i); 61 psFree(conv olved);62 psFree(i mage);63 psFree(convRO); 64 psFree(inRO); 63 65 return NULL; 64 66 } … … 73 75 if (!kernel) { 74 76 psError(PS_ERR_UNKNOWN, false, "Unable to generate kernel image."); 75 psFree(conv olved);76 psFree(i mage);77 psFree(convRO); 78 psFree(inRO); 77 79 return NULL; 78 80 } … … 85 87 psFree(kernel); 86 88 87 psImage *subConv = psImageSubset(conv olved, *region); // Sub-image of convolved image89 psImage *subConv = psImageSubset(convRO->image, *region); // Sub-image of convolved image 88 90 psBinaryOp(subConv, subConv, "*", psScalarAlloc(1.0 / sum, PS_TYPE_F32)); 89 91 } 90 psFree(image); 92 psFree(inRO); 93 psImage *convolved = psMemIncrRefCounter(convRO->image); 94 psFree(convRO); 91 95 92 96 // Threshold the convolved image
Note:
See TracChangeset
for help on using the changeset viewer.
