27#ifndef XSH_UTILS_IMAGE_H
28#define XSH_UTILS_IMAGE_H
54#define TRANSFO_AFFINE 0
56#define TRANSFO_HOMOGRAPHIC 2
59#define SHIFT_REJECT_L 2
60#define SHIFT_REJECT_R 2
61#define SHIFT_REJECT_T 2
62#define SHIFT_REJECT_B 2
70#define TABSPERPIX (1000)
71#define KERNEL_WIDTH (2.0)
72#define KERNEL_SAMPLES (1+(int)(TABSPERPIX * KERNEL_WIDTH))
74#define TANH_STEEPNESS (5.0)
88 cpl_polynomial * poly_u,
89 cpl_polynomial * poly_v
95 float thresh_sigma_factor,
110 double master_noise);
113 const cpl_image *second_raw,
124 const cpl_polynomial *poly_x,
125 const cpl_polynomial *poly_y);
156 const char* prefix,
const char* rec_prefix,
157 const int win_min,
const int win_max,
159 const int method,
const int compute_qc);
164 const int hsize,
const int method);
174 cpl_imagelist** mask,
175 const cpl_image* data_ima,
176 const cpl_image* mask_ima,
180 cpl_imagelist** errs,
181 cpl_imagelist** qual,
182 const cpl_image* flux_b,
183 const cpl_image* errs_b,
184 const cpl_image* qual_b,
185 const int mk,
const int decode_bp);
203 const char* name_o,
const int ext_i,
214 const int mode,
const int win_hsz);
217 const int mode,
const int win_hsz);
220 cpl_mask* bpm, cpl_table* tab_bpm,
const int mode,
221 const int win_hsz,
const int decode_bp);
225 cpl_mask* bpm, cpl_table* tab_bpm,
const int mode,
226 const int win_hsz,
const int decode_bp);
static xsh_instrument * instrument
cpl_image * xsh_image_smooth_median_y(cpl_image *inp, const int r)
double * xsh_generate_interpolation_kernel(const char *kernel_type)
void xsh_show_interpolation_kernel(char *kernel_name)
double xsh_image_get_stdev_robust(const cpl_image *image, double cut, double *dstdev)
Get robust empirical stdev of data.
cpl_error_code xsh_image_mflat_detect_blemishes(cpl_frame *flat_frame, xsh_instrument *instrument)
Flag blemishes in a flat image.
cpl_image * xsh_compute_scale_tab3(cpl_imagelist *iml_data, cpl_imagelist *iml_qual, cpl_mask *bpm, cpl_table *tab_bpm, const int mode, const int win_hsz, const int decode_bp)
double xsh_fixed_pattern_noise_bias(const cpl_image *first_raw, const cpl_image *second_raw, double ron)
Compute fixed pattern noise in bias.
cpl_image * xsh_warp_image_generic(cpl_image *image_in, char *kernel_type, cpl_polynomial *poly_u, cpl_polynomial *poly_v)
cpl_error_code xsh_image_cut_dichroic_uvb(cpl_frame *frame1d)
cpl_image * xsh_compute_scale_tab(cpl_imagelist *iml_data, cpl_mask *bpm, cpl_table *tab_bpm, const int mode, const int win_hsz)
cpl_image * xsh_sobel_lx(cpl_image *in)
Compute X Sobel filter transformation.
void xsh_pixel_qsort(pixelvalue *pix_arr, int npix)
cpl_image * xsh_scharr_y(cpl_image *in)
Compute Y Scharr filter transformation.
cpl_error_code xsh_image_warp_polynomial_scale(cpl_image *, const cpl_polynomial *poly_x, const cpl_polynomial *poly_y)
Compute area change ratio for a 2D polynomial transformation.
cpl_frame * xsh_frame_image_mult_by_fct(cpl_frame *frm, const int fctx, const int fcty)
double xsh_image_fit_gaussian_max_pos_x_window(const cpl_image *ima, const int llx, const int urx, const int ypos)
cpl_table * xsh_qual2tab(cpl_image *bpm, const int code)
double xsh_fixed_pattern_noise(const cpl_image *master, double convert_ADU, double master_noise)
Compute fixed pattern noise in flat field.
cpl_image * xsh_image_smooth_fft(cpl_image *inp, const int fx, const int fy)
cpl_image * xsh_image_smooth_mean_y(cpl_image *inp, const int r)
cpl_error_code xsh_iml_merge_avg(cpl_imagelist **data, cpl_imagelist **mask, const cpl_image *data_ima, const cpl_image *mask_ima, const int mk)
merge imagelist via average
cpl_frame * xsh_frame_image_qc_trace_window(cpl_frame *frm_ima, xsh_instrument *instrument, const char *suffix, const int hsize, const int method)
Trace object position in an image.
cpl_image * xsh_image_smooth_mean_x(cpl_image *inp, const int r)
cpl_image * xsh_image_search_bad_pixels_via_noise(cpl_imagelist *darks, float thresh_sigma_factor, float low_threshold, float high_threshold, int llx, int lly, int urx, int ury)
search bad pixels
cpl_error_code xsh_frame_image_save2ext(cpl_frame *frm, const char *name_o, const int ext_i, const int ext_o)
cpl_image * xsh_sobel_ly(cpl_image *in)
Compute Y Sobel filter transformation.
cpl_frame * xsh_frame_image_ext_qc_trace_window(cpl_frame *frm_ima, xsh_instrument *instrument, const char *suffix, const int hsize, const int method)
Trace object position in an image.
cpl_image * xsh_compute_scale_tab2(cpl_imagelist *iml_data, cpl_imagelist *iml_qual, cpl_mask *bpm, cpl_table *tab_bpm, const int mode, const int win_hsz, const int decode_bp)
cpl_error_code xsh_collapse_errs(cpl_image *errs, cpl_imagelist *list, const int mode)
cpl_image * xsh_image_smooth_median_x(cpl_image *inp, const int r)
cpl_frame * xsh_cube_qc_trace_window(cpl_frame *frm_cube, xsh_instrument *instrument, const char *prefix, const char *rec_prefix, const int win_min, const int win_max, const int hsize, const int method, const int compute_qc)
Trace object position in a cube.
cpl_image * xsh_combine_flats(cpl_image *ima1_in, cpl_image *ima2_in, xsh_order_list *qth_list, xsh_order_list *d2_list, const int xrad, const int yrad)
Combine flat frames line adjusting illumination level to merge them smoothly.
cpl_image * xsh_compute_scale(cpl_imagelist *iml_data, cpl_mask *bpm, const int mode, const int win_hsz)
cpl_error_code xsh_compute_ron(cpl_frameset *frames, int llx, int lly, int urx, int ury, int nsampl, int hsize, const int reg_id, double *ron, double *ron_err)
compute ron taking random windows of given size in a given region on 2 frames difference
double * xsh_generate_tanh_kernel(double steep)
cpl_frame * xsh_frame_image_div_by_fct(cpl_frame *frm, const int fctx, const int fcty)
cpl_image * xsh_image_compute_geom_corr(cpl_image *in)
Pixel area geometric trasformation computation.
cpl_error_code xsh_frame_image_add_double(cpl_frame *frm, const double value)
cpl_image * xsh_scharr_x(cpl_image *in)
Compute X Scharr filter transformation.
cpl_image * xsh_image_smooth_median_xy(cpl_image *inp, const int r)
cpl_error_code xsh_iml_merge_wgt(cpl_imagelist **data, cpl_imagelist **errs, cpl_imagelist **qual, const cpl_image *flux_b, const cpl_image *errs_b, const cpl_image *qual_b, const int mk, const int decode_bp)
merge imagelist via average
double xsh_image_get_stdev_clean(const cpl_image *image, double *dstdev)
Get clean (3*sigma clip) empirical stdev of data.