Sensor¶
This module provides utilities to simulate a camera sensor and obtain its specifications (resolution, pixel size, diagonal).
On the roadmap:
Couple
VirtualSensorwith lens / mask / aperture.Add noise to
VirtualSensor.Set object height
VirtualSensor.Similar class as
VirtualSensorfor “real” sensors to capture images.
Options¶
- class lensless.hardware.sensor.SensorOptions(value)[source]¶
Available sensor options.
basler_287: Basler daA720-520um Sensor (IMX 287)basler_548: Basler daA2448-70uc Sensor (IMX 548)
Virtual Sensor¶
- class lensless.hardware.sensor.VirtualSensor(pixel_size, resolution, diagonal=None, color=True, bit_depth=None, downsample=None, **kwargs)[source]¶
Virtual sensor class to simulate capturing a scene.
- __init__(pixel_size, resolution, diagonal=None, color=True, bit_depth=None, downsample=None, **kwargs)[source]¶
Base constructor.
- Parameters
pixel_size (array-like or float) – 2D pixel size in meters.
resolution (array-like) – 2D resolution in pixels.
diagonal (float, optional) – Diagonal size in meters.
color (bool, optional) – Whether the sensor is color or monochrome.
bit_depth (list, optional) – List of supported bit depths.
downsample (int, optional) – Downsample the sensor by this factor. Pixel size and resolution are adjusted accordingly.
- capture(scene=None, bit_depth=None, bayer=False)[source]¶
Virtual capture of a scene (assuming perfectly focused lens).
- downsample(factor)[source]¶
Downsample the sensor by a given factor. Pixel size and resolution are adjusted accordingly.
- Parameters
factor (int) – Downsample factor.
- classmethod from_name(name, downsample=None)[source]¶
Create a sensor from one of the available options in
SensorOptions.- Parameters
name (str) – Name of the sensor.
- Returns
sensor – Sensor.
- Return type
VirtualSensor