IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 1105


Ignore:
Timestamp:
Jun 25, 2004, 2:37:55 PM (22 years ago)
Author:
Paul Price
Message:

Reworked convolution and bias subtraction. Defined splines.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/archive/modules/include/phase2.h

    r975 r1105  
    2424/* Convolution */
    2525
     26/** A convolution kernel */
     27typedef struct {
     28    int xMin, yMin;                     ///< Most negative indices
     29    int xMax, yMax;                     ///< Most positive indices
     30    float **kernel;                     ///< The kernel data
     31} psKernel;
     32
     33/** Constructor */
     34psKernel *psKernelAlloc(int xMin,       ///< Size of the kernel in the negative x direction
     35                        int xMax,       ///< Size of the kernel in the positive x direction
     36                        int yMin,       ///< Size of the kernel in the negative y direction
     37                        int yMax        ///< Size of the kernel in the positive y direction
     38                        );
     39/** Destructor */
     40void psKernelFree(psKernel *myKernel    ///< Kernel to destroy
     41                  );
     42
    2643/** Returns the kernel of OT shifts made during the course of the exposure. */
    27 psImage *psPhase2GetKernel(psVector *xShifts, ///< List of OT shifts in x; integers
    28                            psVector *yShifts ///< List of OT shifts in y; integers; xshifts->n == yShifts->n
    29                            );
     44psKernel *psPhase2GetKernel(const psVector *xShifts, ///< List of OT shifts in x; integers
     45                            const psVector *yShifts ///< List of OT shifts in y; integers;
     46                                                    ///< xshifts->n == yShifts->n
     47                            );
    3048
    3149/** Returns an image that is the result of convolving the input image with the specified kernel. */
    32 psImage *psPhase2ConvolveWithKernel(psImage *out, ///< Output image, or NULL
    33                                     const psImage *in, ///< Input image to be convolved
    34                                     const psImage *kernel ///< Kernel by which to convolve
    35                                     );
     50psImage *psConvolveWithKernel(psImage *out, ///< Output image, or NULL
     51                              const psImage *in, ///< Input image to be convolved
     52                              const psKernel *kernel, ///< Kernel by which to convolve
     53                              bool direct ///< Do direct convolution?  If not, use FFT
     54                              );
    3655
    3756/************************************************************************************************************/
     
    5574                       );
    5675
     76/** A 1D cubic-spline */
     77typedef struct {
     78    int n;                              ///< Number of spline pieces
     79    float *coeff[4];                    ///< Coefficients.  There are 4 coefficients for each spline piece.
     80    float *coeffErr[4];                 ///< Errors in the coefficients.
     81    bool *mask[4];                      ///< Mask for the coefficients.
     82    float *domains;                     ///< The boundaries between each spline piece.  Size is n+1.
     83} psSpline1D;
     84
     85/** Constructors */
     86psSpline1D *psSpline1DAlloc(int n,      ///< Number of spline pieces
     87                            float min,  ///< Minimum data value
     88                            float max   ///< Maximum data value
     89                            );
     90psSpline1D *psSpline1DAllocGeneric(const psVector *bounds ///< Boundaries between each spline piece.  Number
     91                                                          ///< of spline pieces can hence be inferred.
     92                                   );
     93/** Destructor */
     94void psSpline1DFree(psSpline1D *mySpline ///< Spline to destroy
     95                    );
     96/** Evaluator */
     97float psSpline1DEval(const psSpline1D *spline, ///< Spline to evaluate
     98                     float x            ///< Coordinates at which to evaluate
     99                     );
     100
     101
    57102/** Overscan axis */
    58103typedef enum {
    59     PS_OVERSCAN_NONE = 0,               ///< No overscan subtraction
    60     PS_OVERSCAN_ROWS = 1,               ///< Subtract rows
    61     PS_OVERSCAN_COLUMNS = 2,            ///< Subtract columns
    62     PS_OVERSCAN_ROWS_FIT = -1,          ///< Subtract a fit to rows
    63     PS_OVERSCAN_COLUMNS_FIT = -2,       ///< Subtract a fit to columns
    64     PS_OVERSCAN_ALL = 3                 ///< Subtract the statistic of all pixels in overscan region
     104    PS_OVERSCAN_NONE,                   ///< No overscan subtraction
     105    PS_OVERSCAN_ROWS,                   ///< Subtract rows
     106    PS_OVERSCAN_COLUMNS,                ///< Subtract columns
     107    PS_OVERSCAN_ALL                     ///< Subtract the statistic of all pixels in overscan region
    65108} psOverscanAxis;
     109
     110/** Fit type for bias */
     111typedef enum {
     112    PS_OVERSCAN_FIT_NONE,               ///< No fit to bias
     113    PS_OVERSCAN_FIT_LINEAR,             ///< Do linear interpolation on bias
     114    PS_OVERSCAN_FIT_POLYNOMIAL,         ///< Fit polynomial to bias
     115    PS_OVERSCAN_FIT_CHEBYSHEV,          ///< Fit chebyshev to bias
     116    PS_OVERSCAN_FIT_SPLINE              ///< Fit cubic splines to bias
     117} psBiasFit;
    66118
    67119/** Subtracts an overscan and bias from the input image. */
    68120psReadout *psPhase2SubtractBias(psReadout *in, ///< Input image to be de-biased, and output
    69                                 psPolynomial1D *polySpec, ///< Polynomial specification to use for fit,
    70                                                           ///< outputed
     121                                void *fitSpec, ///< Polynomial/Spline/Some other function(?) specification,
     122                                               ///< Also outputted
     123                                psOverscanAxis overscanAxis, ///< Overscan axis
     124                                psBiasFit fit, ///< How to fit the bias
     125                                int nBin, ///< Number of bins for overscan vector before fitting
    71126                                const psList *regions, ///< Linked list of psImageRegion types.
    72                                 psOverscanAxis overscanAxis, ///< Overscan axis
    73                                 const psStatsOptions *stat, ///< Statistic to use
     127                                const psStats *stat, ///< Statistic to use
    74128                                const psImage *bias ///< Bias (or dark) image to subtract
    75129                                );
Note: See TracChangeset for help on using the changeset viewer.