Haze Simulation Module#

Weather conditions reduce visibility between the sensor and target by lowering contrast, softening edges, and obscuring fine details. These effects can cause missed detections, reduced confidence scores, fragmented or unstable tracks, and noisier segmentation masks — especially for small or low-texture targets. Because many outdoor computer-vision models are implicitly trained on clear-weather imagery, visibility degradation is a common source of performance drops and a key friction to assess in T&E.

From an ML T&E perspective, haze and mist matter because they introduce a form of domain shift: the pixel statistics of the scene change in ways the model has not learned to generalize to. This makes the risk both frequent in real operations and highly impactful to performance.

NRTK’s HazePerturber approximates this risk by reducing contrast and introducing scattering-like effects guided by a depth map and estimated sky color. This does not attempt full atmospheric physics, but it provides an efficient way to probe model sensitivity to visibility loss during early-stage robustness screening.

../../_images/mist.png

Haze Perturbation#

Simulates reduced visibility (fog, mist, light snow) so you can test how well a model handles low-contrast outdoor scenes.

Use This When…#

  • You want to degrade contrast and partially occlude targets in ground/sea imagery.

  • You need a basic-install perturbation (no pyBSM / optical dependencies).

  • You’re doing early screening of robustness to visibility loss before running heavier T&E analysis (see the full T&E Simulation Guide → HazePerturber T&E guide).

Minimal Code Example#

from nrtk.impls.perturb_image.environment import HazePerturber

perturber = HazePerturber(factor=1.0)  # medium haze
img_out = perturber(image=img_in)

Key Parameters#

  • factor - Overall haze strength.

    Light (0.5)

    Medium (1.0)

    Heavy (1.5)

    ../../_images/haze_light.png ../../_images/haze_medium.png ../../_images/haze_heavy.png
  • depth_map - Optional 2D array describing distance from camera - Default: uniform depth map (all values = 1.0) for simple scenes.

  • sky_color - Optional RGB triplet to approximate sky/background color - Default: estimated from the average image color.

Limitations and Next Steps#