IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 20, 2008, 10:00:01 AM (18 years ago)
Author:
Paul Price
Message:

Adding penalties for large kernel components.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/pap_branch_080617/psModules/src/imcombine/pmSubtractionMatch.c

    r17783 r18239  
    430430                // Generate image with convolution kernels
    431431                int fullSize = 2 * size + 1 + 1;    // Full size of kernel
    432                 psImage *convKernels = psImageAlloc(5 * fullSize - 1, 5 * fullSize - 1, PS_TYPE_F32);
     432                int imageSize = (2 * KERNEL_MOSAIC + 1) * fullSize;
     433                psImage *convKernels = psImageAlloc((mode == PM_SUBTRACTION_MODE_DUAL ? 2 : 1) *
     434                                                    imageSize - 1 +
     435                                                    (mode == PM_SUBTRACTION_MODE_DUAL ? 4 : 0),
     436                                                    imageSize - 1, PS_TYPE_F32);
    433437                psImageInit(convKernels, NAN);
    434438                for (int j = -KERNEL_MOSAIC; j <= KERNEL_MOSAIC; j++) {
     
    451455                        }
    452456                        psFree(kernel);
     457
     458                        if (mode == PM_SUBTRACTION_MODE_DUAL) {
     459                            kernel = pmSubtractionKernelImage(kernels, (float)i / (float)KERNEL_MOSAIC,
     460                                                              (float)j / (float)KERNEL_MOSAIC,
     461                                                              true); // Image of the kernel
     462                            if (!kernel) {
     463                                psError(PS_ERR_UNKNOWN, false, "Unable to generate kernel image.");
     464                                psFree(convKernels);
     465                                goto MATCH_ERROR;
     466                            }
     467
     468                            if (psImageOverlaySection(convKernels, kernel,
     469                                                      (2 * KERNEL_MOSAIC + 1 + i + KERNEL_MOSAIC) * fullSize +
     470                                                      4,
     471                                                      (j + KERNEL_MOSAIC) * fullSize, "=") == 0) {
     472                                psError(PS_ERR_UNKNOWN, false, "Unable to overlay kernel image.");
     473                                psFree(kernel);
     474                                psFree(convKernels);
     475                                goto MATCH_ERROR;
     476                            }
     477                            psFree(kernel);
     478                        }
     479
    453480                    }
    454481                }
Note: See TracChangeset for help on using the changeset viewer.