eradiate.scenes.measure.FisheyeCameraMeasure#

class eradiate.scenes.measure.FisheyeCameraMeasure(id='measure', srf=NOTHING, sampler='independent', rfilter='box', spp_allocation=None, spp_min=2, spp=32, film_resolution=(32, 32), origin=NOTHING, target=NOTHING, up=NOTHING, projection_model='equisolid', fov=<Quantity(180.0, 'degree')>, lens_coefficients=None, image_circle_radius=None, center_x=None, center_y=None, calibration_resolution=None, far_clip=<Quantity(10000.0, 'kilometer')>)#

Bases: Measure

Fisheye camera scene element [fisheye].

This scene element is a thin wrapper around the fisheye sensor kernel plugin. It positions a circular fisheye camera based on a set of vectors specifying the origin, viewing direction and ‘up’ direction of the camera.

Results carry a valid mask flagging the pixels that image a direction, and the projection is published on the dataset attributes, see dataset_attrs().

Parameters:
  • id (str, optional, default: "measure") – Identifier of the current scene element.

  • srf (path-like or str or SpectralResponseFunction or dict, default: DeltaSRF(wavelengths=550.0 * ureg.nm)) – Spectral response function (SRF). If a path is passed, it attempts to load a dataset from that location. If a keyword is passed, e.g. 'sentinel_2a-msi-4', the corresponding dataset is looked up through the file resolver.

  • sampler ({"independent", "stratified", "multijitter", "orthogonal", "ldsampler"}, default: "independent") – Mitsuba sampler used to generate pseudo-random number sequences.

  • rfilter ({"box", "gaussian", "tent", "mitchell", "catmullrom", "lanczos"}, default: "box") – Reconstruction filter used to scatter samples on sensor pixels. By default, using a box filter is recommended.

  • spp_allocation (SampleAllocation or {"weighted", "uniform"}, optional, default: None) – Policy distributing spp across spectral loop iterations. If unset, the sample_allocation setting (environment variable ERADIATE_SAMPLE_ALLOCATION) is used when processing.

  • spp_min (int, default: 2) – Minimum sample count per spectral loop iteration when the "weighted" allocation policy splits spp (e.g. in CKD mode). Ignored in mono mode and by the "uniform" policy. A value of 1 may leave variance outputs undefined (NaN). Raising it raises the minimum valid spp: in CKD mode with a BandSRF, spp_min times the total number of g-points.

  • spp (int, default: 32) – Number of samples per pixel.

  • film_resolution (array-like, default: (32, 32)) – Film resolution as a (width, height) 2-tuple.

  • origin (array-like, default: [1, 1, 1] m) – A 3-vector specifying the position of the camera.

    Unit-enabled field (default: ucc[‘length’]).

  • target (array-like, default: [0, 0, 0] m) – Point location targeted by the camera.

    Unit-enabled field (default: ucc[‘length’]).

  • up (array, default: [0, 0, 1]) – A 3-vector specifying the up direction of the camera; it points to the top of the image. This vector must not be colinear with the camera’s viewing direction, which is given by target - origin.

  • projection_model ({"equidistant", "equisolid", "stereographic", "orthographic", "polynomial"}, default: "equisolid") – Projection model.

  • fov (quantity or float, default: 180°) – Camera field of view, i.e. the full angle subtended by the image circle. For projection_model == 'polynomial' it declares instead the angular domain the calibration was fitted over.

    Unit-enabled field (default: degree).

  • lens_coefficients (float, array-like or str, optional, default: None) – Coefficients of the polynomial projection in ascending order, i.e. [c0, c1, ...] for rho(theta) = c0 * theta + c1 * theta**2 + ..., with theta in radian. Accepts a sequence of numbers or a comma- or whitespace-separated string. Required when projection_model == 'polynomial'; unused otherwise.

  • image_circle_radius (float, optional, default: None) – Radius of the image circle in pixels at calibration_resolution, i.e. the radius that a normalized image radius of rho = 1 corresponds to. Kernel defaults to the disk inscribed in the film if unset.

  • center_x (float, optional, default: None) – Optical-centre x coordinate in pixels at calibration_resolution. Kernel defaults to the film centre if unset.

  • center_y (float, optional, default: None) – Optical-centre y coordinate in pixels at calibration_resolution. Kernel defaults to the film centre if unset.

  • calibration_resolution (array-like, optional, default: None) – Resolution (width, height) in which calibration data are expressed (pixel frame for center_x, center_y, image_circle_radius). Defaults to film_resolution if unset; aspect ratio must match.

  • far_clip (quantity or float, default: 10 000 km) – Distance to the far clip sphere: rays are traced up to this radial distance from the camera.

    Unit-enabled field (default: ucc[length]).

Fields:
  • id (str or None) – Identifier of the current scene element.

  • srf (SpectralResponseFunction) – Spectral response function (SRF).

  • sampler (str) – Mitsuba sampler used to generate pseudo-random number sequences.

  • rfilter (str) – Reconstruction filter used to scatter samples on sensor pixels.

  • spp_allocation (SampleAllocation or None) – Policy distributing spp across spectral loop iterations.

  • spp_min (int) – Minimum sample count per spectral loop iteration when the "weighted" allocation policy splits spp (e.g. in CKD mode).

  • spp (int) – Number of samples per pixel.

  • origin (quantity) – A 3-vector specifying the position of the camera.

  • target (quantity) – Point location targeted by the camera.

  • up (array) – A 3-vector specifying the up direction of the camera; it points to the top of the image.

  • projection_model (str) – Projection model.

  • fov (quantity) – Camera field of view, i.e.

  • lens_coefficients (list of float or None) – Coefficients of the polynomial projection in ascending order, i.e.

  • image_circle_radius (float or None) – Radius of the image circle in pixels at calibration_resolution, i.e.

  • center_x (float or None) – Optical-centre x coordinate in pixels at calibration_resolution.

  • center_y (float or None) – Optical-centre y coordinate in pixels at calibration_resolution.

  • calibration_resolution (tuple of int or None) – Resolution (width, height) in which calibration data are expressed (pixel frame for center_x, center_y, image_circle_radius).

  • far_clip (quantity) – Distance to the far clip sphere: rays are traced up to this radial distance from the camera.

dataset_attrs()#

Return a description of the projection, published as global attributes of the result dataset.

Returns:

dict – The keys are projection_model, projection_formula, fov, fov_units, film_width, film_height, center_x, center_y, image_circle_radius and rho_max, plus lens_coefficients for the polynomial model, in addition to those of Measure.dataset_attrs().

is_distant()#

Return True iff measure records radiometric quantities at infinite distance.

traverse(callback)#

Traverse this scene element and collect kernel dictionary template and parameter update map contributions.

Parameters:

callback (SceneTraversal) – Callback data structure storing the collected data.

update()#

Enforce internal state consistency. This method should be called when fields are modified. It is automatically called as a post-init step.

property film_resolution#

Getter for film resolution as a (int, int) pair.

Type:

tuple

property objects#

Map of child objects associated with this scene element.

Returns:

dict – A dictionary mapping object names to a corresponding object to be inserted in the Eradiate scene graph.

property params#
Returns:

dict[str, SceneParameter] or None – A dictionary mapping parameter paths, consisting of dot-separated strings, to a corresponding update protocol.

property template#

Kernel dictionary template contents associated with this scene element.

Returns:

dict – A flat dictionary mapping dot-separated strings describing the path of an item in the nested scene dictionary to values. Values may be objects which can be directly used by the mitsuba.load_dict() function, or DictParameter instances which must be rendered.

property valid_mask#

Boolean (height, width) array, True where the pixel images a direction. Stored in bitmap layout so that it aligns with the recorded variable.

Type:

ndarray

property var#

Post-processing variable field name and metadata.

Type:

str, dict