Skip to main content

Tools for scanning tire tread(s).

Project description

treadscan

PyPI version Documentation Status

This package provides utilities for extracting tire tread (pattern) from images, or even from video of passing cars.

treadscan

Three main classes are
Detector - picks out stopped cars from continoous footage (like at an intersection, under a traffic light).
Segmentor - finds ellipse defining car wheel in image (using image segmentation techniques).
Extractor - creates a tire model from the ellipse, then "unwraps" the tire tread (or rather part of the tire tread, as only about a quarter of the tread is visible).

Currently Segmentor works correctly only if the car has bright wheels (rims). But there is a way to also extract tire tread from images where this detection method fails, by manual input. In the extras folder, there is another module annotator.py containing the Annotator class and the script manual_annotation.py which uses it. The script manual_annotation.py takes an image as input, which it then allows the user to manually annotate.
The user places specific points over the image, which in turn creates the car wheel and tire model, from which the tire tread is then extracted as usual.

manual annotation

This GUI utilises the OpenCV window, using mouse position and keyboard input to place the points. So to place a point, user can hover over a location and press a specific key, or hold the key while dragging with the mouse.
The points which have to be placed manually are:

  • T - top of car wheel (not the tire but the rim)
  • B - bottom of car wheel
  • R - right (or left) side

These 3 points form an ellipse, which defines the location of car wheel in image (red ellipse in the above image). Then the tire model is extrapolated from that, or can be further modified using the optional points:

  • O - move outer tire ellipse (left yellow ellipse)
  • S - tire sidewall height (height of yellow ellipses)
  • W - tire width (move inner tire ellipse, right yellow ellipse)
  • U - top of tread extraction (starting angle, top of green rectangle)
  • I - bottom of tread extraction (ending angle, bottom of green rectangle)

Pressing SPACEBAR shows preview of extracted tread, BACKSPACE hides this preview. Pressing ENTER saves full size extracted tread as new image. Closing the window or pressing ESCAPE closes the window.

Additionally the treadscan_script.py in the extras folder can process footage (folder of images/video/stream) and extract the tread of each car from the footage. It has 3 modes: manual (user annotates each manually), semiauto (user annotates only those where Segmentor fails) and auto (images where Segmentor fails are discarded). Extracted treads are saved to a folder.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

treadscan-0.2.1.tar.gz (21.4 kB view details)

Uploaded Source

Built Distribution

treadscan-0.2.1-py3-none-any.whl (22.1 kB view details)

Uploaded Python 3

File details

Details for the file treadscan-0.2.1.tar.gz.

File metadata

  • Download URL: treadscan-0.2.1.tar.gz
  • Upload date:
  • Size: 21.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.12

File hashes

Hashes for treadscan-0.2.1.tar.gz
Algorithm Hash digest
SHA256 e49a8b518253bc950aba44762fd124b9b63cd3fa309af01a05632719d0299a28
MD5 ce855a0608c42f6bb9c90e40d0a12ae3
BLAKE2b-256 7661772d7fc95547f7b71505b2b35f7d90615f33a6283d5840c9e1c292879ba1

See more details on using hashes here.

File details

Details for the file treadscan-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: treadscan-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 22.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.12

File hashes

Hashes for treadscan-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4abc82c00b53140bccd6e4afa0298a577ef66cddcd32a9091a213f51ff62b118
MD5 ca88527a295280082bb97761a5d96481
BLAKE2b-256 190a4c3fad04e194edcaca2410e7b0ae9314a46b778c8aa5ea6d805a2f713b01

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page