pybsm.simulation.functional.simulate_image

pybsm.simulation.functional.simulate_image(*, ref_img: RefImage, sensor: Sensor, scenario: Scenario, rng: Generator | int | None = 1) tuple[ndarray, ndarray, ndarray]

Simulates radiometrically accurate imagery collected through a sensor.

We start with a notionally ideal reference image ‘img’, which captures a view of the world of which we would like to simulate a degraded view that would be collected from another imaging system. Our framework for image simulation requires that this reference image is of higher quality and ideally higher resolution than the view we would like to simulate as we can only model further degradation of image quality.

Parameters:
  • ref_img (RefImage) – Reference image to use as the source view of the world to be emulated by the virtual camera defined by ‘sensor’.

  • sensor (Sensor) – Virtual sensor definition.

  • scenario (Scenario) – Specification of the deployment of the virtual sensor within the world relative to the target.

  • rng (np.random.Generator or int)

Returns:

true_img:

Numpy float64 array; the true image in units of photoelectrons

blur_img:

Numpy float64 array; the image after blurring and resampling is applied to true_img (still units of photoelectrons)

noisy_img:

Numpy float64 array; the blur image with photon (Poisson) noise and gaussian noise applied (still units of photoelectrons)

WARNING:

imggsd must be small enough to properly sample the blur kernel. As a guide, if the image system transfer function goes to zero at angular spatial frequency, coff, then the sampling requirement will be readily met if imggsd <= rng/(4*coff). In practice this is easily done by upsampling imgin.

Raises:

ValueError if cutoff Frequency matrix u_rng is not monotonically increasing