front_most#
- rapidtools.processing.street_structures.front_most(u: ndarray, v: ndarray, dist: ndarray, cell_deg: float = 1.0, tolerance: float = 0.2, slack_m: float = 1.0) ndarray[source]#
Which points of a cloud a panorama can see.
A reconstructed point projects into every frame near it, whether or not something stands in between. The cloud itself says when something does: a point is hidden when another point lies in almost the same direction and clearly closer to the camera. Directions are compared on a grid of
cell_degcells, each with its eight neighbors.- Parameters:
u – Normalized column of every point, in
[0, 1].v – Normalized row of every point, in
[0, 1].dist – Distance of every point from the camera.
cell_deg – Size of a direction cell in degrees;
0skips the test and reports every point as seen.tolerance – A point counts as seen when it is no farther than the nearest point around its direction by this fraction …
slack_m – … plus this many meters, which keeps the points of one wall seen at a slant from hiding each other.
- Returns:
np.ndarray – Boolean mask of the points that are seen.
Example
>>> import numpy as np >>> u, v = np.array([0.5, 0.5, 0.75]), np.array([0.5, 0.5, 0.5]) >>> front_most(u, v, np.array([5.0, 20.0, 20.0])).tolist() # tree, wall, wall [True, False, True]