| 139 | |
| 140 | |
| 141 | def get_field_of_view(projected_grid, cur_support_sz, fw, eps, device): |
| 142 | # for each output pixel, map which input pixels influence it, in 1d. |
| 143 | # we start by calculating the leftmost neighbor, using half of the window |
| 144 | # size (eps is for when boundary is exact int) |
| 145 | left_boundaries = fw_ceil(projected_grid - cur_support_sz / 2 - eps, fw) |
| 146 | |
| 147 | # then we simply take all the pixel centers in the field by counting |
| 148 | # window size pixels from the left boundary |
| 149 | ordinal_numbers = fw_arange(ceil(cur_support_sz - eps), fw, device) |
| 150 | return left_boundaries[:, None] + ordinal_numbers |
| 151 | |
| 152 | |
| 153 | def calc_pad_sz(in_sz, out_sz, field_of_view, projected_grid, scale_factor, |