ifw-odp  2.0.0-alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
clipm_priv_image_signal.h
Go to the documentation of this file.
1 
2 /*********************************************************************
3  * E.S.O. - VLT project
4  *
5  * "@(#) $Id: clipm_priv_image_signal.h 279869 2016-03-10 10:52:02Z cgarcia $"
6  *
7  * Private functions for image signal processing
8  *
9  * who when what
10  * -------- ---------- ----------------------------------------------
11  * hlorch 2008-08-28 created
12  */
13 
14 #ifndef CLIPM_PRIV_IMAGE_SIGNAL_H
15 #define CLIPM_PRIV_IMAGE_SIGNAL_H
16 
17 /*-----------------------------------------------------------------------------
18  Includes
19  -----------------------------------------------------------------------------*/
20 
21 #include <cpl.h>
22 
23 /*-----------------------------------------------------------------------------
24  Declaration Block
25  -----------------------------------------------------------------------------*/
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
31 /*-----------------------------------------------------------------------------
32  * Defines
33  * -----------------------------------------------------------------------------*/
34 
35 /*----------------------------------------------------------------------------*/
49 /*----------------------------------------------------------------------------*/
50 #define clipm_priv_image_LOOP_GOOD_DATA_CONST( \
51  TYPE, \
52  IMSIZE_XY, \
53  WDWSIZE_XY, \
54  DATA_WDW, \
55  BADP_WDW, \
56  YACTION, \
57  XACTION, \
58  XACTION_ONLY_WITH_BPM) \
59 do { \
60  int x, \
61  y; \
62  const TYPE *data; \
63  \
64  if (BADP_WDW != NULL) \
65  { \
66  const cpl_binary *badp; \
67  for ( y = 0, data = DATA_WDW, badp = BADP_WDW; \
68  y < WDWSIZE_XY[1]; \
69  y++, data += IMSIZE_XY[0], badp += IMSIZE_XY[0]) \
70  { \
71  YACTION \
72  for (x = 0; x < WDWSIZE_XY[0]; x++) \
73  if (! badp[x]) \
74  { \
75  XACTION \
76  XACTION_ONLY_WITH_BPM \
77  } \
78  } \
79  } \
80  else \
81  { \
82  for ( y = 0, data = DATA_WDW; \
83  y < WDWSIZE_XY[1]; \
84  y++, data += IMSIZE_XY[0]) \
85  { \
86  YACTION \
87  for (x = 0; x < WDWSIZE_XY[0]; x++) \
88  { \
89  XACTION \
90  } \
91  } \
92  } \
93 } while (0)
94 
95 
96 /*-----------------------------------------------------------------------------
97  Prototypes
98  -----------------------------------------------------------------------------*/
99 
101  const void *data,
102  cpl_type type,
103  double xc,
104  double yc,
105  double r,
106  cpl_size xsize,
107  cpl_size ysize,
108  const cpl_binary
109  *badp,
110  cpl_size *nrpix);
111 
112 cpl_error_code clipm_priv_image_estimate_fwhm_xy(
113  const cpl_image *img,
114  const double *xy_peakpos,
115  double bg_level,
116  double *out_xy_fwhm,
117  double *out_xy_middle,
118  double *out_xy_edge_sigma);
119 
120 cpl_error_code clipm_priv_image_get_kappa_sigma(
121  const cpl_image *img,
122  const cpl_size window_xxyy[4],
123  double kappa,
124  double initial_limits[],
125  int nmax_iterations,
126  double *out_mean,
127  double *out_sigma,
128  double *out_kappasigma,
129  cpl_size *out_nused,
130  int *out_niterations);
131 
133  const cpl_image *image,
134  const cpl_size window_xxyy[4],
135  double kappa,
136  double *out_sigma,
137  cpl_size *out_nused);
138 
139 cpl_error_code clipm_priv_image_get_psf_sigma(
140  const cpl_image *img,
141  const cpl_size window_xxyy[4],
142  const double *centre_xy,
143  double bg_level,
144  double cut_lower,
145  double cut_upper,
146  double *sigma_xy,
147  double gain,
148  double *centre_err_xy);
149 
150 cpl_error_code clipm_priv_image_collapse( const cpl_image *image,
151  const cpl_size window_xxyy[4],
152  cpl_array **horizontal,
153  cpl_array **vertical,
154  cpl_array **x_weight_map,
155  cpl_array **y_weight_map);
156 
158  const cpl_image *img,
159  const cpl_size window_xxyy[4],
160  double limit,
161  cpl_size *out_nbad);
162 
163 cpl_image *clipm_priv_image_get_sat( const cpl_image *image,
164  const int window_xxyy[4],
165  cpl_image **contrib_sat);
166 
168  const cpl_image *input,
169  const cpl_matrix *kernel,
170  const cpl_size window_xxyy[4],
171  int extend_bpm,
172  int int2double);
173 
175  const cpl_image *image,
176  const cpl_size window_xxyy[4],
177  double sigma);
178 
180  const cpl_image *img,
181  const cpl_size window_xxyy[4],
182  double *out_sigma,
183  cpl_size *out_nused);
184 
186  const cpl_image *img,
187  double x_peakpos,
188  double y_peakpos,
189  double bg_level);
190 
191 
192 /*----------------------------------------------------------------------------*/
193 
194 #ifdef __cplusplus
195 } /* extern "C" */
196 #endif
197 
198 #endif /* CLIPM_PRIV_IMAGE_SIGNAL_H */
cpl_error_code clipm_priv_image_get_kappa_sigma(const cpl_image *img, const cpl_size window_xxyy[4], double kappa, double initial_limits[], int nmax_iterations, double *out_mean, double *out_sigma, double *out_kappasigma, cpl_size *out_nused, int *out_niterations)
Determine mean and sigma by iteratively ignoring outliers.
Definition: clipm_priv_image_signal.c:1162
cpl_size clipm_priv_image_pixel_count_below(const cpl_image *img, const cpl_size window_xxyy[4], double limit, cpl_size *out_nbad)
Count all the pixels (strictly) below a given limit.
Definition: clipm_priv_image_signal.c:1862
double clipm_priv_image_get_mean_perimeter(const void *data, cpl_type type, double xc, double yc, double r, cpl_size xsize, cpl_size ysize, const cpl_binary *badp, cpl_size *nrpix)
Average values in a buffer along a perimeter.
Definition: clipm_priv_image_signal.c:85
cpl_error_code clipm_priv_image_estimate_fwhm_xy(const cpl_image *img, const double *xy_peakpos, double bg_level, double *out_xy_fwhm, double *out_xy_middle, double *out_xy_edge_sigma)
Estimate the FWHM of an object separable in x and y.
Definition: clipm_priv_image_signal.c:904
cpl_error_code clipm_priv_image_collapse(const cpl_image *image, const cpl_size window_xxyy[4], cpl_array **horizontal, cpl_array **vertical, cpl_array **x_weight_map, cpl_array **y_weight_map)
Collapse an image (by averaging) in both dimensions.
Definition: clipm_priv_image_signal.c:1663
cpl_error_code clipm_priv_image_get_psf_sigma(const cpl_image *img, const cpl_size window_xxyy[4], const double *centre_xy, double bg_level, double cut_lower, double cut_upper, double *sigma_xy, double gain, double *centre_err_xy)
Compute the sigma (RMS) of an object (i.e. the PSF).
Definition: clipm_priv_image_signal.c:1461
cpl_image * clipm_priv_image_conv_matrix(const cpl_image *input, const cpl_matrix *kernel, const cpl_size window_xxyy[4], int extend_bpm, int int2double)
Convolve an image with a kernel stored in a matrix.
Definition: clipm_priv_image_signal.c:2091
double clipm_priv_image_estimate_fwhm_round(const cpl_image *img, double x_peakpos, double y_peakpos, double bg_level)
Estimate the FWHM of a round object.
Definition: clipm_priv_image_signal.c:703
double clipm_priv_image_estimate_bg_in_region(const cpl_image *img, const cpl_size window_xxyy[4], double *out_sigma, cpl_size *out_nused)
Estimate the background in a small image region.
Definition: clipm_priv_image_signal.c:529
cpl_image * clipm_priv_image_filter_lowpass(const cpl_image *image, const cpl_size window_xxyy[4], double sigma)
Convolve an image with a gaussian bell curve.
Definition: clipm_priv_image_signal.c:2471
cpl_image * clipm_priv_image_get_sat(const cpl_image *image, const int window_xxyy[4], cpl_image **contrib_sat)
double clipm_priv_image_estimate_low_kappa_sigma(const cpl_image *image, const cpl_size window_xxyy[4], double kappa, double *out_sigma, cpl_size *out_nused)
Force the iterative kappa-sigma clipping to converge against the dark.
Definition: clipm_priv_image_signal.c:243