Skip to content

Project to distinguish between the four carpet colors present in my office

Notifications You must be signed in to change notification settings

tim-fan/carpet_color_classification

Repository files navigation

carpet-color-classification

Python package for distinguishing between the four colors of carpet in my office, from given images from a floor facing camera.

This is intended for use as a component in a carpet-based robot localisation system.

For an overview of the broader project, see the wiki.

target environment

Figure: Robot in target localisation environment, showing the four carpet colors to be classified.

Classification is performed by taking average HSV values for each input image, and using a gaussian mixture model (GMM) to distinguish the four color clusters in HSV space.

color clusters

Figure: GMM clustering results distinguishing the four color clusters in HSV space.

Classifier training

For an overview on how the classifier is trained, see this notebook.

Usage

See test_carpet_color_classifier.py for an example demonstrating how to construct the classifier from a parameter file, and then use the classifier on given cv2 images.

Tools

This package includes a utility image_recorder for saving images from a webcam to disk (useful in creating training or testing datasets). Usage is as follows:

$ image_recorder -h
image_recorder.

Saves images from webcam to disk

Usage:
    image_recorder <output_directory> [--device=<index>]

Options:
    --device=<index>    Index of video device for capture [default: 0]

About

Project to distinguish between the four carpet colors present in my office

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages