Changeset 26893 for trunk/psModules/src/imcombine/pmStackReject.c
- Timestamp:
- Feb 10, 2010, 7:34:39 PM (16 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/imcombine/pmStackReject.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/imcombine/pmStackReject.c
r25468 r26893 35 35 { 36 36 int size = kernels->size; // Half-size of convolution kernel 37 psImage *polyValues = p_pmSubtractionPolynomialFromCoords(NULL, kernels, numCols, numRows, 38 xMin + size + 1, yMin + size + 1); // Polynomial 37 int x = PS_MIN(xMin + size + 1, kernels->xMax); // x coordinate of interest 38 int y = PS_MIN(yMin + size + 1, kernels->yMax); // y coordinate of interest 39 40 psImage *polyValues = p_pmSubtractionPolynomialFromCoords(NULL, kernels, x, y); // Polynomial 39 41 int box = p_pmSubtractionBadRadius(NULL, kernels, polyValues, false, poorFrac); // Radius of bad box 40 42 psTrace("psModules.imcombine", 10, "Growing by %d", box); … … 150 152 pmReadout *inRO = pmReadoutAlloc(NULL); // Readout with input image 151 153 inRO->image = image; 154 convRO->image = psImageAlloc(image->numCols, image->numRows, PS_TYPE_F32); 152 155 for (int i = 0; i < numRegions; i++) { 153 156 psRegion *region = subRegions->data[i]; // Region of interest 154 157 pmSubtractionKernels *kernels = subKernels->data[i]; // Kernel of interest 155 if (!pmSubtractionConvolve(NULL, convRO, NULL, inRO, NULL, stride, 0, 0, 1.0, 0.0, 158 if (!pmSubtractionConvolve(NULL, convRO, NULL, inRO, NULL, stride, 0, 0, 1.0, 0.0, 0.0, 156 159 region, kernels, false, true)) { 157 160 psError(PS_ERR_UNKNOWN, false, "Unable to convolve mask image in region %d.", i); … … 165 168 166 169 // Image of the kernel at the centre of the region 167 float xNorm = (region->x0 + 0.5 * (region->x1 - region->x0) - kernels->numCols/2.0) / 168 (float)kernels->numCols; 169 float yNorm = (region->y0 + 0.5 * (region->y1 - region->y0) - kernels->numRows/2.0) / 170 (float)kernels->numRows; 171 psImage *kernel = pmSubtractionKernelImage(kernels, xNorm, yNorm, false); 170 psImage *kernel = pmSubtractionKernelImage(kernels, 0.5, 0.5, false); 172 171 if (!kernel) { 173 172 psError(PS_ERR_UNKNOWN, false, "Unable to generate kernel image.");
Note:
See TracChangeset
for help on using the changeset viewer.
