Estimates of the signal values at `X[t]` using a nearest neighbor interpolation strategy. Parameters ---------- X : :py:class:`ndarray ` of shape `(in_length, in_channels)` An input image sampled along an integer `in_length` t : list of length `k`
(X, t)
| 82 | |
| 83 | |
| 84 | def nn_interpolate_1D(X, t): |
| 85 | """ |
| 86 | Estimates of the signal values at `X[t]` using a nearest neighbor |
| 87 | interpolation strategy. |
| 88 | |
| 89 | Parameters |
| 90 | ---------- |
| 91 | X : :py:class:`ndarray <numpy.ndarray>` of shape `(in_length, in_channels)` |
| 92 | An input image sampled along an integer `in_length` |
| 93 | t : list of length `k` |
| 94 | A list of coordinates for the samples we wish to generate |
| 95 | |
| 96 | Returns |
| 97 | ------- |
| 98 | samples : :py:class:`ndarray <numpy.ndarray>` of shape `(k, in_channels)` |
| 99 | The samples for each (x,y) coordinate computed via nearest neighbor |
| 100 | interpolation |
| 101 | """ |
| 102 | nt = np.clip(np.around(t), 0, X.shape[0] - 1).astype(int) |
| 103 | return X[nt, :] |
| 104 | |
| 105 | |
| 106 | def bilinear_interpolate(X, x, y): |
nothing calls this directly
no outgoing calls
no test coverage detected