Functions | |
| static cpl_table * | trace_order (const cpl_table *ordertable, int order, const cpl_image *inputimage, const cpl_image *noise, const cpl_binary *image_bad, int TRACESTEP, double MAXGAP) |
| Trace a single order line. | |
| static int | count_orders (const cpl_table *tracetable) |
| Count orders in trace table. | |
| static double | fit_order_linear (cpl_table *singletrace, int order, double KAPPA, double *slope) |
| Make a linear fit of an order trace. | |
| static int | get_xcenter (int nx, int ny, cpl_table *ordertable, int row) |
| Calculate the x-center of an order. | |
| static int | get_ycenter (int nx, int ny, cpl_table *ordertable, int row) |
| Calculate the y-center of an order. | |
| static int | get_orderlength (int nx, int ny, cpl_table *ordertable, int row) |
| Calculate the length of an order line. | |
| static double | estimate_threshold (const cpl_image *inputimage, const cpl_image *noise, cpl_table *ordertable, int row, double relative_threshold) |
| Calculate threshold for order tracing algorithm. | |
| static bool | find_centroid (const cpl_image *inputimage, const cpl_image *noise, const cpl_binary *image_bad, double threshold, int spacing, int x, double *yguess, double *dY) |
| Find order line centroid. | |
| cpl_table * | uves_locate_orders (const cpl_image *inputimage, const cpl_image *noise, cpl_table *ordertable, int TRACESTEP, double MINTHRESH, double MAXGAP, double MAXRMS, int DEFPOL1, int DEFPOL2, double KAPPA, polynomial **bivariate_fit, int *orders_traced) |
| Trace all orders. | |
| static cpl_table * | detect_lines (cpl_image *htrans, int minintersept, const cpl_image *inputimage, int NORDERS, bool norders_is_guess, int SAMPLEWIDTH, double PTHRES, double MINSLOPE, double MAXSLOPE, int SLOPERES, bool consecutive) |
| Detect order lines from the Hough image. | |
| static cpl_error_code | delete_peak (cpl_image *htrans, int minintersept, int hxmax, int hymax, int SPACING, int imagewidth, int SAMPLEWIDTH, double MINSLOPE, double MAXSLOPE, int SLOPERES) |
| Delete peak in Hough image. | |
| static int | firsttrace (int nx, int SAMPLEWIDTH) |
| Get the first trace column. | |
| static int | calculate_spacing (const cpl_image *image, int x) |
| Estimate spacing of order lines. | |
| static double | autocorr (const cpl_image *image, const int x, const int shift) |
| Calculate auto-correlation function of image column. | |
| static cpl_error_code | update_max (const cpl_image *htrans, int *xmax, int *ymax, int SPACING, int imagewidth, int SAMPLEWIDTH, double MINSLOPE, double MAXSLOPE, int SLOPERES) |
| Improve position of a peak in the Hough image. | |
| cpl_table * | uves_hough (const cpl_image *image, int ymin, int ymax, int NORDERS, bool norders_is_guess, int SAMPLEWIDTH, double PTHRES, double MINSLOPE, double MAXSLOPE, int SLOPERES, bool consecutive, cpl_image **htrans, cpl_image **htrans_original) |
| Compute Hough transform and detect lines. | |
| cpl_error_code | uves_draw_orders (const cpl_table *ordertable, cpl_image *image) |
| Draw detected order lines. | |
|
||||||||||||||||||||||||||||||||
|
Trace a single order line.
The order line is sampled at x-positions seperated by the parameter TRACESTEP. At each x-position, the y-centroid of the order is calculated. The trace stops if the intensity of the order line is below a certain threshold value in a range determined by the parameter MAXGAP. The order is traced as far as possible using the lowest threshold value. The returned table contains three columns, 'X', 'Y' (describing the trace of the order) and 'dY' (uncertainty of 'Y'). Definition at line 1102 of file uves_orderpos_follow.c. References check, find_centroid(), uves_max_int(), uves_min_int(), uves_msg_debug, and xcenter(). Referenced by uves_locate_orders(). |
|
|
Count orders in trace table.
Definition at line 926 of file uves_orderpos_follow.c. References passure. |
|
||||||||||||||||||||
|
Make a linear fit of an order trace.
Definition at line 970 of file uves_orderpos_follow.c. References check, passure, uves_max_int(), uves_msg_debug, uves_polynomial_evaluate_1d(), uves_polynomial_get_coeff_1d(), and uves_polynomial_regression_1d(). Referenced by uves_locate_orders(). |
|
||||||||||||||||||||
|
Calculate the x-center of an order.
Definition at line 1349 of file uves_orderpos_follow.c. References check, and uves_round_double(). Referenced by get_ycenter(), and uves_locate_orders(). |
|
||||||||||||||||||||
|
Calculate the y-center of an order.
get_xcenter() .
Definition at line 1401 of file uves_orderpos_follow.c. References check, get_xcenter(), and uves_round_double(). Referenced by uves_locate_orders(). |
|
||||||||||||||||||||
|
Calculate the length of an order line.
Definition at line 1300 of file uves_orderpos_follow.c. References check, and uves_round_double(). Referenced by uves_locate_orders(). |
|
||||||||||||||||||||||||
|
Calculate threshold for order tracing algorithm.
Definition at line 1434 of file uves_orderpos_follow.c. References assure, check, passure, uves_max_double(), uves_max_int(), uves_min_int(), uves_msg_debug, and uves_round_double(). Referenced by uves_locate_orders(). |
|
||||||||||||||||||||||||||||||||||||
|
Find order line centroid.
All pixels above half peak maximum contribute to the centroid calculation, and the centroid position is refined by making a gaussian fit. Additionally, the function returns true, if the peak intensity is more than 10 sigma, where sigma is the RMS error of the gaussian fit. Definition at line 1575 of file uves_orderpos_follow.c. References assure, passure, uves_error_reset, uves_gauss(), uves_gauss_derivative(), uves_max_int(), uves_min_int(), uves_msg_debug, and uves_round_double(). Referenced by trace_order(). |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Trace all orders.
Definition at line 234 of file uves_orderpos_follow.c. References assure, assure_nomsg, check, estimate_threshold(), fit_order_linear(), get_orderlength(), get_xcenter(), get_ycenter(), passure, trace_order(), and uves_msg_warning. |
|
||||||||||||||||||||||||||||||||||||||||||||||||
|
Detect order lines from the Hough image.
delete_peak() ).
The peak locations are initially defined as the local maximum points but are refined by calculating the centroid of the local area around the maximum (see The number of order lines to detect is specified by the parameter NORDERS. If this parameter is set to zero, the function will detect lines until the intensity of the next candidate drops to below PTHRES times the dimmest line (PTHRES must be between 0 and 1; if norders_is_guess is false, the parameter PTHRES is ignored). An important parameter for the peak removal to work is the (approximate) interorder spacing. This parameter is estimated as the raw image height divided by the predicted number of orders (NORDERS). In automatic mode it is estimated as the first minimum of the auto-correlation function along the column in the Hough image containing the global maximum. Note that these methods assume that the inter order spacing does not vary too much as function of order number. The results of the detection are written to the returned table in the columns 'Slope' (slope of order), 'Intersept' (y-intersept of order) and 'Spacing' (appropriate interorder distance at this order). The table is sorted according to 'Intersept'. The column 'Order' is a label of the order number starting from 1. Definition at line 379 of file uves_orderpos_hough.c. References assure, calculate_spacing(), check, delete_peak(), passure, update_max(), uves_msg, uves_msg_debug, uves_msg_warning, and uves_round_double(). Referenced by uves_wavecal_search(). |
|
||||||||||||||||||||||||||||||||||||||||||||
|
Delete peak in Hough image.
The peak location (in Hough space) is mapped to a line in the input image (using the inverse Hough transformation). The Hough transform of this (one-dimensional) line is a (two-dimensional) butterfly-shaped area, which is then removed. See code for details. Definition at line 947 of file uves_orderpos_hough.c. References assure, check, and firsttrace(). Referenced by detect_lines(). |
|
||||||||||||
|
Get the first trace column.
Definition at line 911 of file uves_orderpos_hough.c. Referenced by delete_peak(), and uves_hough(). |
|
||||||||||||
|
Estimate spacing of order lines.
Definition at line 818 of file uves_orderpos_hough.c. References assure, autocorr, check, and uves_msg_debug. Referenced by detect_lines(). |
|
||||||||||||||||
|
Calculate auto-correlation function of image column.
|
|
||||||||||||||||||||||||||||||||||||||||
|
Improve position of a peak in the Hough image.
Only pixels with values above ( (1 - 0.5 / NOT) * peak_value ) contribute to the calculation of the centroid. (Here NOT is the number of sample traces in the input image, and peak_value is the pixel value of the detected maximum.) Definition at line 737 of file uves_orderpos_hough.c. References assure, and uves_round_double(). Referenced by detect_lines(). |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Compute Hough transform and detect lines.
See also Possible order line slopes range from MINSLOPE to MAXSLOPE . The function assumes that all slopes are positive and small. To detect lines with slopes larger than 0.3 - 0.5 or so, the algorithm should be changed to use polar (i.e. rotation invariant) coordinates in Hough space. Definition at line 180 of file uves_orderpos_hough.c. References assure, assure_nomsg, check, check_nomsg, firsttrace(), uves_msg, uves_msg_progress, uves_msg_warning, and uves_round_double(). |
|
||||||||||||
|
Draw detected order lines.
Definition at line 999 of file uves_orderpos_hough.c. References check, passure, and uves_round_double(). |
|
|
Calculate auto-correlation function of image column.
Definition at line 109 of file irplib_detmon.c. Referenced by calculate_spacing(). |
1.4.6