sphere_snap.sphere_snap
Reproject various image types by projecting them first on a sphere surface
Returns the points on the sphere in xyz that are mapped to these uv (image) coordinates or None if neither point is in the view's bounds
Returns the points on the sphere (in spherical coordinates) that are mapped to these uv (image) coordinates or None if neither point is in the view's bounds
Returns the coordinates in the source image that are mapped to this snap image pixel coordinates
Given the spherical coords (phi, theta) in radians, returns the corresponding uv points
Given some xyz points on the normalised sphere surface returns the coordinates in the current image if exists and [-1,-1] if is outside optionally can return the outside indices
Keep all the same snap configuration bot different orientation
Returns an array of the snap out_hw size that has the image source coordinates for each pixel
Transforms from image coordinates to sphere coordinates return the image sphere
Transforms from sphere coordinates to image coordinates return the image coordinates
Parameters
- spherical: spherical coordinates for the sphere surface points that we want to project
- snap_config: a snap_config object containing metadata of the snap
Given a list of images extracted from a source image, re-create an image return the full image obtained from the source views
Parameters
- output_hw: a tuple containing source image size(height, width)
- views: a list of views we want to merge back in the full image
- imgs: a list of imgs coresponding to the views
- merge_method: average, sum, max, last
- target_type: image projection type (equi, fisheye180)
Given a polygon on the sphere returns all the 2d points inside it from the source image
Parameters
- points: polygon xyz points on the sphere
- hw: resolution of the source image you want to sample from
- source_img_fov_deg: a tuple containing (hfov, vfov) of the perspective source image, if this is None the image is equirectangular
- source_dist_coeff: None if does not exist, array containing radial distortion parameters, offset center should be normalised {lambda, center_offset_x, center_offest_y}
- return_polar: If true, it will return also the sphere projection of the points in polar coordinates