Rescales the image in linear RGB so that a neutral reference patch photographed in every image (grey card, white standard, colour-checker neutral patch) takes its known CIELAB value. This is a diagonal (von Kries-type) correction: it removes differences in exposure and white balance between photographs, which is essential for comparing absolute \(L^*\) (melanization) across plates, days and cameras.
calibrate_color(plate, region, ref_lab = c(50, 0, 0))The calibrated mycohalo_plate (with $calibration gains).
A photographic 18 % grey card has \(L^* \approx 50\); the neutral 5 patch of an X-Rite ColorChecker Classic has \(L^* \approx 51\). The patch must be evenly lit and not clipped.
sim <- simulate_plate(width = 300, height = 400, seed = 2, exposure = 0.8, grey_card = TRUE)
plate <- read_plate(sim$image)
plate <- calibrate_color(plate, region = sim$truth$grey_card)
#> Warning: 0.44 % of channel values exceed 1 after calibration and were clipped.