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:
MeasureFisheye camera scene element [
fisheye].This scene element is a thin wrapper around the
fisheyesensor 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
validmask flagging the pixels that image a direction, and the projection is published on the dataset attributes, seedataset_attrs().- Parameters:
id (
str, optional, default:"measure") – Identifier of the current scene element.srf (path-like or
strorSpectralResponseFunctionordict, 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 (
SampleAllocationor{"weighted", "uniform"}, optional, default:None) – Policy distributingsppacross spectral loop iterations. If unset, thesample_allocationsetting (environment variableERADIATE_SAMPLE_ALLOCATION) is used when processing.spp_min (
int, default:2) – Minimum sample count per spectral loop iteration when the"weighted"allocation policy splitsspp(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 validspp: in CKD mode with aBandSRF,spp_mintimes 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 bytarget - origin.projection_model (
{"equidistant", "equisolid", "stereographic", "orthographic", "polynomial"}, default:"equisolid") – Projection model.fov (
quantityorfloat, default:180°) – Camera field of view, i.e. the full angle subtended by the image circle. Forprojection_model == 'polynomial'it declares instead the angular domain the calibration was fitted over.Unit-enabled field (default: degree).
lens_coefficients (
float, array-like orstr, optional, default:None) – Coefficients of the polynomial projection in ascending order, i.e.[c0, c1, ...]forrho(theta) = c0 * theta + c1 * theta**2 + ..., withthetain radian. Accepts a sequence of numbers or a comma- or whitespace-separated string. Required whenprojection_model == 'polynomial'; unused otherwise.image_circle_radius (
float, optional, default:None) – Radius of the image circle in pixels atcalibration_resolution, i.e. the radius that a normalized image radius ofrho = 1corresponds to. Kernel defaults to the disk inscribed in the film if unset.center_x (
float, optional, default:None) – Optical-centre x coordinate in pixels atcalibration_resolution. Kernel defaults to the film centre if unset.center_y (
float, optional, default:None) – Optical-centre y coordinate in pixels atcalibration_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 forcenter_x,center_y,image_circle_radius). Defaults tofilm_resolutionif unset; aspect ratio must match.far_clip (
quantityorfloat, 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:
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 (
SampleAllocationorNone) – Policy distributingsppacross spectral loop iterations.spp_min (
int) – Minimum sample count per spectral loop iteration when the"weighted"allocation policy splitsspp(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 (
listoffloatorNone) – Coefficients of the polynomial projection in ascending order, i.e.image_circle_radius (
floatorNone) – Radius of the image circle in pixels atcalibration_resolution, i.e.center_x (
floatorNone) – Optical-centre x coordinate in pixels atcalibration_resolution.center_y (
floatorNone) – Optical-centre y coordinate in pixels atcalibration_resolution.calibration_resolution (
tupleofintorNone) – Resolution (width, height) in which calibration data are expressed (pixel frame forcenter_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 areprojection_model,projection_formula,fov,fov_units,film_width,film_height,center_x,center_y,image_circle_radiusandrho_max, pluslens_coefficientsfor the polynomial model, in addition to those ofMeasure.dataset_attrs().
- is_distant()#
Return
Trueiff 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 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] orNone– A dictionary mapping parameter paths, consisting of dot-separated strings, to a corresponding update protocol.
See also
- 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 themitsuba.load_dict()function, orDictParameterinstances which must be rendered.
See also
- property valid_mask#
Boolean
(height, width)array,Truewhere the pixel images a direction. Stored in bitmap layout so that it aligns with the recorded variable.- Type:
ndarray