00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #if !defined(PM_IMAGE_COMBINE_H)
00015 #define PM_IMAGE_COMBINE_H
00016
00017 #if HAVE_CONFIG_H
00018 #include <config.h>
00019 #endif
00020
00021 #include<stdio.h>
00022 #include<math.h>
00023 #include "pslib.h"
00024 #include "psConstants.h"
00025
00026 typedef enum {
00027 PM_SUBTRACTION_KERNEL_POIS,
00028 PM_SUBTRACTION_KERNEL_ISIS
00029 } pmSubtractionKernelsType;
00030
00031 typedef struct
00032 {
00033 pmSubtractionKernelsType type;
00034 psVector *u, *v;
00035 psVector *sigma;
00036 psVector *xOrder, *yOrder;
00037 int subIndex;
00038 psArray *preCalc;
00039
00040 psS32 p_size;
00041 psS32 p_spatialOrder;
00042 }
00043 psSubtractionKernels;
00044
00045 psSubtractionKernels *pmSubtractionKernelsAllocPOIS(int size,
00046 int SpatialOrder);
00047
00048 psSubtractionKernels *pmSubtractionKernelsAllocISIS(const psVector *sigmas,
00049 const psVector *orders,
00050 int size,
00051 int SpatialOrder);
00052
00053 typedef enum {
00054 PM_STAMP_INIT,
00055 PM_STAMP_USED,
00056 PM_STAMP_REJECTED,
00057 PM_STAMP_RECALC,
00058 PM_STAMP_NONE
00059 } pmStampStatus;
00060
00061 typedef struct
00062 {
00063 int x, y;
00064 psImage *matrix;
00065 psVector *vector;
00066 pmStampStatus status;
00067 }
00068 pmStamp;
00069
00070 psArray *pmSubtractionFindStamps(psArray *stamps,
00071 const psImage *image,
00072 const psImage *mask,
00073 psU32 maskVal,
00074 psF32 threshold,
00075 psS32 xNum,
00076 psS32 yNum,
00077 psS32 border
00078 );
00079
00080 bool pmSubtractionCalculateEquation(psArray *stamps,
00081 const psImage *reference,
00082 const psImage *input,
00083 const psSubtractionKernels *kernels,
00084 psS32 footprint
00085 );
00086
00087
00088 psVector *pmSubtractionSolveEquation(psVector *solution,
00089 const psArray *stamps
00090 );
00091
00092 bool pmSubtractionRejectStamps(psArray *stamps,
00093 psImage *mask,
00094 psU32 badStampMaskVal,
00095 psS32 footprint,
00096 psF32 sigmaRej,
00097 const psImage *refImage,
00098 const psImage *inImage,
00099 const psVector *solution,
00100 const psSubtractionKernels *kernels
00101 );
00102
00103 psImage *pmSubtractionKernelImage(psImage *out,
00104 const psVector *solution,
00105 const psSubtractionKernels *kernels,
00106 psF32 x,
00107 psF32 y
00108 );
00109
00110 #endif