00001 00002 /*--------------------------------------------------------------------------- 00003 00004 File name : correlation.h 00005 Author : Nicolas Devillard 00006 Created on : Sept 1st, 1995 00007 Description : correlation (up to subpixel) routines 00008 00009 ---------------------------------------------------------------------------*/ 00010 00011 /* 00012 $Id: correlation.h,v 1.1 2003/09/03 12:50:47 amodigli Exp $ 00013 $Author: amodigli $ 00014 $Date: 2003/09/03 12:50:47 $ 00015 $Revision: 1.1 $ 00016 */ 00017 00018 #ifndef _CORRELATION_H_ 00019 #define _CORRELATION_H_ 00020 00021 /*--------------------------------------------------------------------------- 00022 Includes 00023 ---------------------------------------------------------------------------*/ 00024 00025 #include <stdio.h> 00026 #include <math.h> 00027 00028 #include "comm.h" 00029 #include "static_sz.h" 00030 #include "memory.h" 00031 #include "cube_handling.h" 00032 #include "image_stats.h" 00033 #include "image_intops.h" 00034 #include "detect_peaks.h" 00035 #include "find_obj.h" 00036 #include "resampling.h" 00037 #include "doubles.h" 00038 #include "intimage.h" 00039 00040 /*--------------------------------------------------------------------------- 00041 Defines 00042 ---------------------------------------------------------------------------*/ 00043 00044 /* Correlation area definition */ 00045 00046 #define CORR_DX_MAX 5 00047 #define CORR_DY_MAX 5 00048 00049 /* Surface of measurement */ 00050 00051 #define CORR_HX 25 00052 #define CORR_HY 25 00053 00054 00055 /*--------------------------------------------------------------------------- 00056 Function ANSI C prototypes 00057 ---------------------------------------------------------------------------*/ 00058 00059 /*-------------------------------------------------------------------------*/ 00092 /*--------------------------------------------------------------------------*/ 00093 00094 00095 double3 * 00096 get_median_offset_xcorr( 00097 OneImage * reference, 00098 OneImage * compared, 00099 double3 * estimate, 00100 double3 * xcorr_p, 00101 int search_width, 00102 int search_height, 00103 int hx, 00104 int hy 00105 ) ; 00106 00107 00108 /*-------------------------------------------------------------------------*/ 00152 /*--------------------------------------------------------------------------*/ 00153 00154 00155 double 00156 private_correlation( 00157 pixelvalue *buffer_in1, /* Search is made on this buffer */ 00158 pixelvalue *buffer_in2, /* This is the pattern we are looking for */ 00159 int lx1, /* nb pixels/row buffer 1 */ 00160 int ly1, /* nb of rows in buffer1 */ 00161 int lx2, /* nb pixels/row buffer 2 */ 00162 int ly2, /* nb of rows in buffer2 */ 00163 int at_x1, /* Search center in buffer 1 */ 00164 int at_y1, 00165 int at_x2, /* Search center in buffer 2 */ 00166 int at_y2, 00167 int dx_max, /* Search area size */ 00168 int dy_max, 00169 int hx, /* Measure area size */ 00170 int hy, 00171 double *dx, /* Returned apodized position in x */ 00172 double *dy ) ; /* Returned apodized position in y */ 00173 00174 00175 /*-------------------------------------------------------------------------*/ 00206 /*--------------------------------------------------------------------------*/ 00207 00208 double3 * 00209 xcorr_with_objs( 00210 OneCube * to_compare, 00211 OneImage * pattern, 00212 double3 * estimates, 00213 double3 * xcorr_p, 00214 int search_width, 00215 int search_height, 00216 int hx, 00217 int hy); 00218 00219 00220 /*-------------------------------------------------------------------------*/ 00256 /*--------------------------------------------------------------------------*/ 00257 00258 double3 * load_offsets_from_txtfile(char * filename); 00259 00260 00261 /*-------------------------------------------------------------------------*/ 00286 /*--------------------------------------------------------------------------*/ 00287 00288 int 00289 shift_cube( 00290 OneCube * to_shift, 00291 double3 * offsets, 00292 char * kernel 00293 ) ; 00294 00295 00296 /*-------------------------------------------------------------------------*/ 00324 /*--------------------------------------------------------------------------*/ 00325 intimage * 00326 shift_cube_int_expand( 00327 OneCube ** to_shift, 00328 double3 * offsets) ; 00329 00330 00331 /*-------------------------------------------------------------------------*/ 00359 /*--------------------------------------------------------------------------*/ 00360 00361 00362 int 00363 shift_cube_int( 00364 OneCube * to_shift, 00365 double3 * offsets 00366 ) ; 00367 00368 /*-------------------------------------------------------------------------*/ 00402 /*--------------------------------------------------------------------------*/ 00403 00404 double3 * 00405 get_xcorrelation_points( 00406 OneImage * in_image, 00407 int edge_x, 00408 int edge_y, 00409 double sigma_threshold, 00410 int min_points, 00411 int max_points); 00412 00413 00414 /*-------------------------------------------------------------------------*/ 00438 /*--------------------------------------------------------------------------*/ 00439 00440 00441 void 00442 localize_xcorr_centers( 00443 double3 * peaks, 00444 int lx, 00445 int ly, 00446 int edge_x, 00447 int edge_y, 00448 int * nvalid, 00449 int * valid_flags 00450 ) ; 00451 00452 #endif
1.2.13.1 written by Dimitri van Heesch,
© 1997-2001