MCPcopy Create free account
hub / github.com/Meshcapade/difflocks / get_field_of_view

Function get_field_of_view

utils/resize_right/resize_right.py:141–150  ·  view source on GitHub ↗
(projected_grid, cur_support_sz, fw, eps, device)

Source from the content-addressed store, hash-verified

139
140
141def 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
153def calc_pad_sz(in_sz, out_sz, field_of_view, projected_grid, scale_factor,

Callers 1

resizeFunction · 0.85

Calls 2

fw_ceilFunction · 0.85
fw_arangeFunction · 0.85

Tested by

no test coverage detected