isce3  0.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Pages
kernels.h
1 // -*- C++ -*-
2 // -*- coding: utf-8 -*-
3 //
4 // michael a.g. aïvázis <michael.aivazis@para-sim.com>
5 // parasim
6 // (c) 1998-2019 all rights reserved
7 //
8 
9 // code guard
10 #if !defined(ampcor_libampcor_correlators_kernels_h)
11 #define ampcor_libampcor_correlators_kernels_h
12 
13 // STL
14 #include <complex>
15 
16 // forward declarations
17 namespace ampcor {
18  namespace kernels {
19  // compute amplitudes of the tile pixels
20  void detect(const std::complex<float> * cArena, std::size_t cells, float * rArena);
21 
22  // subtract the tile mean from each reference pixel
23  void refStats(float * rArena,
24  std::size_t pairs, std::size_t refDim, std::size_t cellsPerTilePair,
25  float * stats);
26 
27  // build the sum area tables for the target tiles
28  void sat(const float * rArena,
29  std::size_t pairs,
30  std::size_t refCells, std::size_t tgtCells, std::size_t tgtDim,
31  float * sat);
32 
33  // compute the average amplitude for all possible placements of a reference shape
34  // within the search windows
35  void tgtStats(const float * sat,
36  std::size_t pairs,
37  std::size_t refDim, std::size_t tgtDim, std::size_t corDim,
38  float * stats);
39 
40  // compute the correlation matrix
41  void correlate(const float * rArena, const float * refStats, const float * tgtStats,
42  std::size_t pairs,
43  std::size_t refCells, std::size_t tgtCells, std::size_t corCells,
44  std::size_t refDim, std::size_t tgtDim, std::size_t corDim,
45  float * dCorrelation);
46 
47  // compute the locations of the maximum value of the correlation map
48  void maxcor(const float * cor,
49  std::size_t pairs, std::size_t corCells, std::size_t corDim,
50  int * loc);
51 
52  // nudge the (row, col) pairs so that they describe sub-tiles within a target tile
53  void nudge(std::size_t pairs,
54  std::size_t refDim, std::size_t tgtDim, std::size_t margin,
55  int * locations, float * offsets);
56 
57  // migrate the expanded maxcor tiles to the refinement arena
58  void migrate(const std::complex<float> * arena,
59  std::size_t pairs,
60  std::size_t refDim, std::size_t tgtDim, std::size_t expDim,
61  std::size_t refRefinedDim, std::size_t tgtRefinedDim,
62  const int * locations,
63  std::complex<float> * refinedArena);
64 
65  // upcast the correlation matrix into complex numbers and embed in the zoomed
66  // hyper-matrix
67  auto r2c(const float * gamma,
68  std::size_t pairs, std::size_t corDim, std::size_t zmdDim
69  ) -> std::complex<float> *;
70 
71  // convert the zoomed correlation matrix to floats
72  auto c2r(const std::complex<float> * scratch,
73  std::size_t pairs, std::size_t zmdDim
74  ) -> float *;
75 
76  // assemble the offset field
77  void offsetField(const int * zoomed,
78  std::size_t pairs,
79  std::size_t margin, std::size_t refineMargin, std::size_t zoom,
80  float * field);
81  }
82 }
83 
84 // code guard
85 #endif
86 
87 // end of file

Generated for ISCE3.0 by doxygen 1.8.5.