Handling Warehouse Lighting in OpenCV Pipelines

Published 2026-08-11 by Faraz Rahimi

Sodium lights, LED retrofits, and open dock doors at noon are three different datasets. A single histogram setting will not survive a week.

Handling Warehouse Lighting in OpenCV Pipelines

Tags: OpenCV, Computer Vision, Python, Warehouse, unlisted

I used to tune CLAHE until a folder of sample photos looked pretty. Then night shift sent a batch that was basically orange noise, and day shift sent photos with a white rectangle where the dock door blew out the sensor.

Lighting is not a preprocessing footnote. It is the domain.

Detect the lighting class cheaply

A very small classifier — even rules on color temperature and brightness — lets you pick a preprocessing path. Warm and dark gets one stretch. Cold and bright gets another. Blown highlights get a request for a different angle, not a hallucination.

I log which path ran with each image. When accuracy drops, I can see that we hired a new lighting layout in aisle 4, not that "the model got worse."

Shoot a calibration set when lights change

When facilities replace bulbs, I ask for twenty photos of known SKUs under the new lights. That is cheaper than rediscovering the failure in mis-picks.

Original post: https://farazrahimi.com/posts/handling-warehouse-lighting-in-opencv-pipelines