sphere_snap.snap_config

class SnapConfig:

Contains all properties needed to construct an image snap

SnapConfig( orientation_quat, out_hw, out_fov_deg, source_img_hw, source_img_fov_deg=None, source_dist_coeff=None, source_img_type='equi')

Given the input parameters, creates an ImageViewProperties object

The camera coordinate system is (xy in the screen plane, z+ going in the screen): ^ / z / x |------------> | | | y v where z is the viewing direction of the camera. This system follows the right-hand rule.

Parameters
  • fov_deg: a tuple containing (hfov, vfov)
  • orientation_quat: array_like (4,1) of an orientation
  • out_hw: a tuple containing output image size(height, width)
  • source_dist_coeff: array containing distortion parameters, center offset should be normalised {lambda, center_offset_x, center_offset_y} (Default: None)
  • source_img_hw: a tuple containing source image size(height, width)
  • source_img_fov_deg: a tuple containing (hfov, vfov) of the perspective source image, if this is None the image is equirectangular
  • source_img_type: type of the source image eg. (plane, equi, fisheye180), default is equi.
def to_numpy(self):
@classmethod
def createFromPoint( cls, center_point_xyz, out_hw, out_fov_deg, source_img_hw, source_img_fov_deg=None, source_dist_coeff=None, source_img_type='equi', quaternion=None):

Given the input parameters, creates an ImageViewProperties object

Parameters
  • center_point_xyz: a point on the sphere where we want the view to be centered; for a point to be on the sphere, its corresponding position vector should have magnitude of 1 (= radius of sphere) and x, y, z in [-1, 1]
  • out_fov_deg: a tuple containing (hfov, vfov)
  • out_hw: a tuple containing output image size(height, width)
  • source_dist_coeff: array containing distortion parameters,center offset should be normalised {lambda, center_offset_x, center_offest_y} (Default: None)
  • source_img_hw: a tuple containing source image size(height, width)
  • source_img_fov_deg: a tuple containing (hfov, vfov) of the perspective source image, if this is None the image is equirectangular
  • quaternion: optional array_like (4,1) of an orientation, usually used to specify the upright orientation
def set_transform(self, transform):