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