File: hdrl_correlation.h

package info (click to toggle)
cpl-plugin-amber 4.4.3%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 9,340 kB
  • sloc: ansic: 89,588; sh: 4,337; makefile: 620; python: 295
file content (97 lines) | stat: -rw-r--r-- 3,242 bytes parent folder | download | duplicates (12)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
/* $Id: hdrl_correlation.h,v 0.1 2017-04-12 16:49:47 msalmist Exp $
 *
 * This file is part of the HDRL
 * Copyright (C) 2017 European Southern Observatory
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 */

/*
 * $Author: msalmist $
 * $Date: 2017-04-12 16:49:47 $
 * $Revision: 0.1 $
 * $Name: not supported by cvs2svn $
 */

#ifndef HDRL_CORRELATION_H
#define HDRL_CORRELATION_H

/*-----------------------------------------------------------------------------
                                   Includes
 -----------------------------------------------------------------------------*/

#include <cpl.h>
#include "hdrl_types.h"

CPL_BEGIN_DECLS


typedef struct{
    double peakpos; /* Position of the peak of the gaussian fitted  to the cross correlation */
    double sigma;   /* Width of the gaussian fitted  to the cross correlation */
    double area;    /* Area of the gaussian fitted  to the cross correlation */
    double offset;  /* Fitted background level */
    double mse;     /* Mean squared error of the best fit */
    cpl_array * xcorr; /* Cross-correlation */
    cpl_size pix_peakpos; /* Pixel position of the peak */
    cpl_size half_window;
}hdrl_xcorrelation_result;

hdrl_xcorrelation_result *
hdrl_xcorrelation_result_wrap(cpl_array * x_corr,  const cpl_size max_idx,
        const cpl_size half_window);

void hdrl_xcorrelation_result_delete(hdrl_xcorrelation_result * self);

cpl_size
hdrl_xcorrelation_result_get_peak_pixel(const hdrl_xcorrelation_result * self);

double
hdrl_xcorrelation_result_get_peak_subpixel(const hdrl_xcorrelation_result * self);

cpl_size
hdrl_xcorrelation_result_get_half_window (const hdrl_xcorrelation_result * self);

double
hdrl_xcorrelation_result_get_sigma(const hdrl_xcorrelation_result * self);

const cpl_array *
hdrl_xcorrelation_result_get_correlation(const hdrl_xcorrelation_result * self);


hdrl_xcorrelation_result * hdrl_compute_xcorrelation(
       const cpl_array * arr1,
       const cpl_array  * arr2,
       const cpl_size half_window, const cpl_boolean normalize);

hdrl_xcorrelation_result * hdrl_compute_offset_gaussian(
        const cpl_array * arr1,
        const cpl_array  * arr2,
        const cpl_size half_win, const cpl_boolean normalize,
        const double bin, const double wrange);

#if defined HDRL_USE_PRIVATE

hdrl_xcorrelation_result *
hdrl_compute_offset_gaussian_internal(
        const cpl_array * arr1, const cpl_array * arr2,
        const cpl_size half_win, const cpl_boolean normalize,
        const double bin, const double wrange);

#endif

CPL_END_DECLS

#endif