cambrian.eyes.optics¶
This is an optics-enabled eye, which implements a height map and a PSF on top of the existing eye.
Classes¶
Base dataclass which provides additional methods for working with configs. |
|
This defines the config for the circular aperture. This extends the base aperture |
|
This defines the config for the custom aperture. This extends the base aperture |
|
This defines the config for the optics module. This extends the base eye config |
|
This class applies the depth invariant PSF to the image. |
Module Contents¶
- class MjCambrianApertureConfig[source]¶
Bases:
hydra_config.HydraContainerConfig
,abc.ABC
Base dataclass which provides additional methods for working with configs.
- class MjCambrianCircularApertureConfig[source]¶
Bases:
MjCambrianApertureConfig
This defines the config for the circular aperture. This extends the base aperture config and adds additional parameters for the circular aperture.
- Variables:
radius (float) – Radius of the circular aperture.
- class MjCambrianMaskApertureConfig[source]¶
Bases:
MjCambrianApertureConfig
This defines the config for the custom aperture. This extends the base aperture config and adds additional parameters for the custom aperture.
- Variables:
mask (Optional[List[List[int]]]) – Aperture mask. This is a 2D array that defines the aperture mask. The aperture mask is a binary mask that defines the aperture of the lens. It’s a binary mask where 1 lets light through and 0 blocks it. The mask can only be None if randomize is True or if size is not None. Defaults to None.
randomize (bool) – Randomize the aperture mask. If True, the aperture mask is randomized.
random_prob (Optional[float]) – Probability of the aperture mask being 1. If None, the probability is 0.5. Defaults to None.
size (Optional[Tuple[int, int]]) – Size of the aperture mask. If None, the size is the same as the pupil resolution. Defaults to None.
- class MjCambrianOpticsEyeConfig[source]¶
Bases:
cambrian.eyes.eye.MjCambrianEyeConfig
This defines the config for the optics module. This extends the base eye config and adds additional parameters for the optics module.
- Variables:
pupil_resolution (Tuple[int, int]) – Resolution of the pupil plane. This is used to calculate the PSF.
noise_std (float) – Standard deviation of the Gaussian noise to be added to the image. If 0.0, no noise is added.
wavelengths (Tuple[float, float, float]) – Wavelengths of the RGB channels.
f_stop (float) – F-stop of the lens. This is used to calculate the PSF.
refractive_index (float) – Refractive index of the lens material.
height_map (List[float]) – Height map of the lens. This is used to calculate the phase shift of the light passing through the lens. Uses a radially symmetric approximation.
scale_intensity (bool) – Whether to scale the intensity of the PSF by the overall throughput of the aperture.
aperture (MjCambrianApertureConfig) – Aperture config. This defines the aperture of the lens. The aperture can be circular or custom.
depths (List[float]) – Depths at which the PSF is calculated. If empty, the psf is calculated for each render call; otherwise, the PSFs are precomputed.
- class MjCambrianOpticsEye(config, name)[source]¶
Bases:
cambrian.eyes.eye.MjCambrianEye
This class applies the depth invariant PSF to the image.
- Parameters:
config (MjCambrianOpticsConfig) – Config for the optics module.