sphere_snap.utils
Given to sets of coordinates creates a map between them returns map from undistorted to distorted coordinates, the map might contain NaN values where there are not distortion calculated
Constructs the image using the computed coordinates clamp: determines how texture is sampled when texture coord are out of the typical 0..1 range, If True texture edge pixels are stretched when outside of range.
Given a polygon on the sphere returns all the points inside it in eq coordinates
Parameters
- points: polygon xyz points on the sphere
- hw: resolution of the source image you want to sample from
- full_img_fov_deg: a tuple containing (hfov, vfov) of the perspective source image, if this is None the image is equirectangular
Returns an array of True (for uv coordinates in array that are in hw bound) and False (otherwise)
Returns focal lenght given resolution and fov
Returns pinhole camera fov given focal length and resolution
Returns pinhole camera resolution given focal length and fov
check for square pixels given pinhole camera asumption
if we don't have square pixels we assume the vfov is correct and adjust hfov accordingly.