Self-Driving Camera Lab

Software that remotely controls a camera test lab (lights, motorized stages, focus motors and the camera under test), finds the best setup on its own, and searches the space of test conditions for the cases where the camera performs worst.

Credit
7 points
Team
Up to 3 students
Partners
HIT and Samsung
On-site work
Required, at the lab

A research project for an industry customer. There is no ready recipe: the team defines the details of the method, reads the literature, tries ideas, measures, and learns from what does not work. The project requires independent work, proactive exploration and a lot of trial and error, with regular meetings with the supervisor and periodic meetings with the Samsung team.

On-site visits required: the equipment is in a test lab on site. Most development is done remotely against simulated (mock) devices, but integration and testing with the real hardware require regular visits to the lab. Students should plan for scheduled lab days during both semesters, with more of them in the integration phase.

Description

Camera image quality is measured in labs with test charts, calibrated lights and precise positioning. Today, much of this setup is manual: moving the camera, aligning it to the chart, setting the light, focusing, and capturing. This project turns the lab into a programmable, self-driving system in three steps.

(a) Unified API. One software interface for every device in the lab: light sources (intensity, color temperature, flicker), motorized positioning (linear and rotation stages, pan-tilt, robot arm), focus motors, and the camera or phone under test. Every capture is logged together with the full state of all devices.

(b) Automatic best setup. Algorithms that find the right settings on their own: align the camera to the chart (position and angle), make the lighting uniform, and find the best focus.

(c) Smart exploration and failure hunting. A strategy that scans the space of configurations with as few captures as possible, first to get a representative sample of camera behavior, then to actively hunt for configurations where the camera under-performs. Both static conditions and dynamic ones (moving targets, camera shake, changing or flickering light) are covered.

Tasks to automate

The lab team has defined the first tasks. Each action must be fitted to the specific chart being shot, so every chart gets a definition (its markers, regions of interest and target pose) that the routines read.

TaskWhat the software must doMain technique
Sensor arm alignmentMove the sensor so it faces the chart at the right distance and orientation (height, pitch, roll, yaw)Fiducial marker detection, pose estimation (PnP), closed-loop correction
Image focusFind the sharpest focus position for the chart and distanceFocus measure on chart regions, coarse-to-fine search
Light source adjustmentSet intensity and color temperature; check that the chart is evenly litMeasure gray patches across the chart, adjust lights
Exposure and white balanceChoose exposure time and gain so the chart is well exposed without clipping, and estimate white balance from neutral patchesRAW histogram and clipping checks, gray-patch statistics
Chart movementBring the requested chart in front of the sensorMotorized chart track, position check with markers

Main challenges

The lab and its hardware

Based on photos of the lab, the setup includes the equipment below. The interfaces listed are our best guess from the visible hardware and will be confirmed during the first lab visit.

EquipmentWhat it doesLikely interface and API
Long linear stage (track on the table)Moves the sensor arm toward and away from the charts (distance), controlled from the lab computerZaber motorized stage; Zaber Motion Library (Python), Zaber ASCII protocol over USB/serial
Zaber sensor mount: vertical lift plus rotation stagesHeight, pitch, roll and yaw of the sensorZaber stages on the same controller chain; same library. Some pitch/roll stages look manual (scales and knobs) and may need motorizing
Sensor board on the mountThe camera sensor under test, delivering RAW CFA framesVendor capture software or SDK; the project wraps it with a capture service (command line or library call)
Chart wall on sliding tracksSeveral large test charts that can slide sideways in an aluminum profile frameCurrently manual; can be motorized with a belt or linear drive (a Zaber stage, or a stepper motor with an Arduino / GRBL controller)
Test charts with fiducial bordersMulti-target charts (Siemens stars, slanted edges, color patches, texture) surrounded by square markersPassive; the markers make automatic alignment possible with OpenCV ArUco-style detection
Ceiling spotlights (two, NANLITE)Main lighting for the chartsProfessional LED fixtures usually support DMX512; control from Python through a USB-DMX interface (for example ENTTEC DMX USB Pro with DMXEnttecPro or OLA), or the maker's wireless app protocol
Standing light panels (light boxes on wheels)Diffuse, uniform illumination or backlit targetsDepends on model: DMX, USB/serial, or manual dimmer; to be checked on site
Ceiling LED panelsRoom light, a source of stray lightBuilding control; at least on/off should be scripted or switched off for tests
Web power switch (remotely switched outlets)Turns equipment on and off, resets devices remotelyDigital Loggers Web Power Switch, HTTP/REST API; Python dlipower
ATEN unit on the rigProbably a USB or KVM extender carrying signals from the rig to the lab computerTransparent to software, but affects cabling and latency
Small camera above the chart wall; ceiling dome cameraOverview of the labCan serve as a remote "eye" for safe operation (check that the path is clear before moving)

Safety: remote motion needs software limits for every axis, a collision check between the arm and the chart wall, and an emergency stop that works from the remote interface.

Motivation

Goals and deliverables

  1. A device layer with a common interface (connect, set, read, move, capture), drivers for each lab device, and a mock version of each device for development without hardware.
  2. A lab service: a documented REST or gRPC API, an event bus for device status, and a database of every capture with its full configuration.
  3. Auto-setup routines: chart alignment with fiducial markers, autofocus search, and lighting uniformity optimization.
  4. An exploration engine: space-filling sampling, Bayesian optimization, and failure search, with a report that maps where the camera performs well and badly.
  5. Dynamic tests: synchronized runs with motion and changing light.
  6. A demonstration in the lab showing a full unattended test campaign.

Suggested approach

What students will need

A map of the concepts, methods and tools this project touches. The first weeks are for learning the essentials.

Concepts

Algorithms and techniques

Software engineering

Evaluation

  • Alignment repeatability (reprojection error, angle)
  • Autofocus accuracy and number of steps
  • Share of a campaign run unattended
  • Coverage vs. number of captures
  • Failures found per capture budget vs. random sampling

Tools and frameworks

Reference test systems

Existing automated test suites, characterization standards and commercial systems show how industry camera labs are built.

SystemWhat it covers
IEEE 1858 (CPIQ)Camera phone image quality metrics
IEEE 2020Automotive camera quality, including LED flicker
EMVA 1288Sensor and camera characterization
Android Camera ITSAutomated camera test suite with open rig designs (ITS-in-a-box)
Image Engineering LE7Programmable uniform light source with API
Image Engineering STEVE-6D6-axis shake robot for stabilization tests
Imatest, DXOMARKCommercial image quality analysis and test protocols

Useful Software and Libraries

ToolRole in the project
Bluesky, ophyd-asyncExperiment orchestration and hardware abstraction, from large science facilities
bluesky-adaptiveAdaptive scans driven by a search agent redesign announced
pycro-managerPython control of cameras, stages and lights via Micro-Manager
PyVISA, PyMeasure, pylablibInstrument drivers
ADB, Camera2, scrcpyRemote control of the phone under test
gphoto2, Harvester, AravisControl of DSLRs and machine vision cameras
Thorlabs Kinesis, Zaber Motion Library, PI pipythonMotorized stage SDKs
GRBL, ArduinoLow-cost motor control
ros2_control, MoveIt 2Robot arm control and motion planning
Open Lighting ArchitectureDMX control of studio lights
FastAPI, gRPC, MQTT, ZeroMQLab service API and messaging
OpenCV ArUco / ChArUco, ViSPPose estimation and visual servoing for alignment
MTF MapperOpen-source slanted-edge sharpness measurement
scipy.stats.qmcSobol and Latin hypercube sampling
BoTorch, Ax, OptunaBayesian optimization
pyribsQuality-diversity search (MAP-Elites) for diverse failure cases
VerifAI + ScenicFalsification toolkit for systems that use perception

Avoid: GPyOpt (archived in 2023). Consumer smart bulbs are not repeatable enough for measurement lighting.

Relevant papers

Self-driving labs and adaptive experiments

  1. Häse, Roch, Aspuru-Guzik. Next-Generation Experimentation with Self-Driving Laboratories. Trends in Chemistry 2019.
  2. Abolhasani, Kumacheva. The Rise of Self-Driving Labs in Chemical and Materials Sciences. Nature Synthesis 2023.
  3. Pinkard et al. Pycro-Manager: open-source software for customized and reproducible microscope control. Nature Methods 2021.

Testing and failure search

  1. Dreossi et al. VerifAI: A Toolkit for the Formal Design and Analysis of Artificial Intelligence-Based Systems. CAV 2019.
  2. Abdessalem, Nejati, Briand, Stifter. Testing Vision-Based Control Systems Using Learnable Evolutionary Algorithms. ICSE 2018.
  3. Gotovos et al. Active Learning for Level Set Estimation. IJCAI 2013. Finds the boundary between good and bad regions.
  4. Tian et al. DeepTest: Automated Testing of Deep-Neural-Network-Driven Autonomous Cars. ICSE 2018.
  5. Pei et al. DeepXplore: Automated Whitebox Testing of Deep Learning Systems. SOSP 2017.
  6. Mouret, Clune. Illuminating Search Spaces by Mapping Elites (MAP-Elites). 2015.
  7. Baek et al. Unexplored Faces of Robustness and Out-of-Distribution: Covariate Shifts in Environment and Sensor Domains (ImageNet-ES). CVPR 2024. About 202k photos taken while physically varying light and camera settings; very close in spirit to this project.

Optimization, sampling and focus

  1. Balandat et al. BoTorch: A Framework for Efficient Monte-Carlo Bayesian Optimization. NeurIPS 2020.
  2. Shahriari et al. Taking the Human Out of the Loop: A Review of Bayesian Optimization. Proceedings of the IEEE 2016.
  3. Pertuz, Puig, García. Analysis of Focus Measure Operators for Shape-from-Focus. Pattern Recognition 2013.
  4. Garrido-Jurado et al. Automatic Generation and Detection of Highly Reliable Fiducial Markers under Occlusion (ArUco). Pattern Recognition 2014.

Prerequisites