Skip to content

LeafarCoder/ColorCovid

Repository files navigation

ColorCovid

A collaboration between Faculty of Pharmacy and IST, both from the University of Lisbon.

Given a photograph of an array of COVID-19 test samples, ColorCovid automatically detects each sample well, extracts its color characteristics, and classifies which tests are positive.

Features

  • Camera control — connect any camera to the computer and capture snapshots directly from the GUI
  • Sample detection — automatically locates and uniquely indexes each well in the plate, handling variable array layouts, well shapes, and lighting conditions
  • Color feature extraction — computes HSV and RGB channel averages per sample and exports them to CSV
  • Classification — classifies each sample as positive or negative based on its color features

Requirements

pip install opencv-python numpy matplotlib scikit-image scipy pillow imutils easygui

How It Works

The image processing pipeline detects and segments individual wells through five stages:

Processing steps
Original image
Step 1 Detect the background
Step 2 High-saturation threshold to broadly locate the wells
Step 3 Remove the background
Step 4 Euclidean distance mask
Step 5 Watershed algorithm — final sample markers

Detection works across a range of plate formats and lighting conditions:

Detection examples
Original Detected samples

Color Analysis

Each detected sample is uniquely indexed on the plate:

Color features (H, S, V, R, G, B averages) for all samples are exported to a CSV file:

A built-in visualization tool lets you inspect each sample individually and browse all color data at a glance:

Samples can be shown with their surrounding border or cropped tightly to the region of interest:

With border Cropped to ROI

The list can be sorted by any parameter — color channel, test result, or sample index:

By RGB value (red channel) By test result By sample index

Author

Rafael Correia — LinkedIn

About

Automatic visual classification of covid-19 test results.

Topics

Resources

License

Stars

Watchers

Forks

Contributors

Languages