Skip to contents

In-field botanical imagery frequently suffers from adverse optical conditions, including severe underexposure under dense closed canopies, twilight illumination, motion blur from drone vibrations, and optical defocus. image_restore_dl() provides deep neural restorers to recover degraded imagery prior to phenotyping:

  • Low-Light Enhancement ("lowlight", Zero-DCE): Zero-Reference Deep Curve Estimation enhances underexposed images dynamically without over-amplifying noise or distorting color balance.

  • Defocus and Motion Deblurring ("deblur" / "denoise", NAFNet): Nonlinear Activation Free Network removes optical and motion blur.

Usage

image_restore_dl(
  img,
  method = c("lowlight", "denoise", "deblur"),
  tile_size = 512L,
  tile_pad = 16L,
  threads = 0,
  engine = c("gpu", "cpu"),
  device_id = -1,
  verbose = TRUE,
  plot = TRUE,
  dir = pliman_model_dir(),
  ...
)

Arguments

img

An Image object or character string path to an image file.

method

Restoration method: "lowlight" (Zero-DCE curve enhancement, default), "denoise", or "deblur" (NAFNet).

tile_size

Tile dimension in pixels for memory-efficient tiled processing of large images (default 512L).

tile_pad

Overlap padding between adjacent processing tiles to prevent boundary seams (default 16L).

threads

Number of CPU execution threads (default 0 for auto-detect).

engine

Compute engine: "gpu" (default) or "cpu".

device_id

GPU device ID (default -1 for auto).

verbose

Logical. Whether to display progress messages (default TRUE).

plot

Logical. Whether to render the visual restoration plot (default TRUE).

dir

Model directory (default pliman_model_dir()).

...

Additional arguments passed to graphics::plot().

Value

An Image object containing the restored image.

References

  • Guo, C., Li, C., Guo, J., Loy, C. C., Hou, J., Kwong, S., & Cong, R. (2020). Zero-reference deep curve estimation for low-light image enhancement. Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), 1780–1789.

  • Chen, L., Chu, X., Zhang, X., & Sun, J. (2022). Simple baselines for image restoration. European Conference on Computer Vision (ECCV), 17–33.

Examples

if (FALSE) { # interactive()
  library(pliman)
  subsposed <- image_import("subesposta")
  restored <- image_restore_dl(subsposed, method = "lowlight")
}