MCPcopy Create free account
hub / github.com/UVA-Computer-Vision-Lab/FrameINO / mesh_grid

Function mesh_grid

utils/optical_flow_utils.py:168–181  ·  view source on GitHub ↗

Generate the mesh grid, centering at zero. Args: kernel_size (int): Returns: xy (ndarray): with the shape (kernel_size, kernel_size, 2) xx (ndarray): with the shape (kernel_size, kernel_size) yy (ndarray): with the shape (kernel_size, kernel_size)

(kernel_size)

Source from the content-addressed store, hash-verified

166
167
168def mesh_grid(kernel_size):
169 """Generate the mesh grid, centering at zero.
170 Args:
171 kernel_size (int):
172 Returns:
173 xy (ndarray): with the shape (kernel_size, kernel_size, 2)
174 xx (ndarray): with the shape (kernel_size, kernel_size)
175 yy (ndarray): with the shape (kernel_size, kernel_size)
176 """
177 ax = np.arange(-kernel_size // 2 + 1., kernel_size // 2 + 1.)
178 xx, yy = np.meshgrid(ax, ax)
179 xy = np.hstack((xx.reshape((kernel_size * kernel_size, 1)), yy.reshape(kernel_size * kernel_size,
180 1))).reshape(kernel_size, kernel_size, 2)
181 return xy, xx, yy
182
183
184def pdf2(sigma_matrix, grid):

Callers 1

bivariate_GaussianFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected