Skip to main content

A package to perform image analysis on archaeological tools.

Project description

AScheck

This script can easily load and perform calculations on a directory of images.

Functionality can be added to the core.ascheck.Image class. This can then be called from the ascheck script.

The script can find the biggest assumed object in an image by binarizing it in the object and the background. The contour of the object can then easily be found.

Currently, the script can compute the asymmetry index of the biggest assumed object in an image and it can compute the width of the object at a given set of intervals along its longest dimension.

The asymmetry of the object can be computed by flipping it along its longest axis. The difference in pixels between the minimum and the maximum symmetric outline defines the asymmetric pixels. Dividing this number by the total number of pixels in the object, gives the asymmetry index.

Installation

Using pip

ascheck is available on PyPI, install using

pip install ascheck --upgrade

After installing, simply open a terminal and type the following command

ascheck

Github

The package can be installed from Github by running the following commands in the preferred installation location:

git clone https://github.com/StijnDebackere/AScheck
cd AScheck
python3 setup.py install

After installing, simply open a terminal and type the following command

ascheck

Usage

After installing the package, you should be able to run it from anywhere within the terminal alt text

A dialog will open asking you for the folder that contains your images.

alt text

Choose the folder and the program will ask some questions: do you want to compute the asymmetry?

alt text

Optionally, diagnostic images can also be saved to check whether anything went wrong in the automatic object detection.

alt text

We also ask whether you want to compute the slices

alt text

and how many

alt text

again, with optional diagnostics.

Outputs

The asymmetry calculation creates a folder bw/ in the selected folder where it saves the black and white outlines and it will save the asymmetry indices in a file called ascheck_results.txt. This text file contains the image filename, its asymmetry index and a flag for the trustworthiness of the result.

As diagnostic, the following images are saved:

  • image_name_asym.ext: black and white image of the asymmetric pixels
  • image_name_contour.ext: grayscale image with the contour filled in red

alt text alt text

The object widths calculation creates a folder slices/ in the selected folder where it saves .csv files with the coordinates of each interval and the lower and upper intersections with the object outline. It also provides the coordinates in normalized form, where the widths are divided by the geometric mean of the widths of all intervals.

As diagnostic, the object and all the coordinates are saved in

  • image_name_slices.ext: grayscale image with contour filled in red, the central intervals indicated with crosses, and the intersections with dots.

alt text

Example

We start out with the image of a biface.

alt text

This image is then converted into a grayscale and the object is separated from the background. Now we have a black and white image of the biface for which we can find the contour.

alt text

The contour can then be flipped around the longest axis of the biface, which is assumed to be the axis of symmetry. By taking the difference between the minimum and maximum symmetric outlines, we find the number of asymmetric pixels.

alt text

Computing the intervals along the longest axis, the intersections with the contour can then be found.

alt text

Issues

The object detection in the script is automatic and it assumes that the foreground object is clearly marked against the background. Do not put the object on a background with similar colours, since the script will fail in that case. Diagnostic images should enable you to see whether everything went OK.

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

ascheck-0.0.3.2.tar.gz (11.2 kB view details)

Uploaded Source

Built Distribution

ascheck-0.0.3.2-py3-none-any.whl (18.5 kB view details)

Uploaded Python 3

File details

Details for the file ascheck-0.0.3.2.tar.gz.

File metadata

  • Download URL: ascheck-0.0.3.2.tar.gz
  • Upload date:
  • Size: 11.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.0.post20201006 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.3

File hashes

Hashes for ascheck-0.0.3.2.tar.gz
Algorithm Hash digest
SHA256 b79b53e77d4196b1011cc3ed1501ce3cc7badc563b225b96ec7ffa0a20da781e
MD5 276379972b6d3a25da112aba69547e9a
BLAKE2b-256 3ef52bfe02401d4cbd9f2af69c11a5954ceb1e8bf4963dff20c77cbb30831ef0

See more details on using hashes here.

File details

Details for the file ascheck-0.0.3.2-py3-none-any.whl.

File metadata

  • Download URL: ascheck-0.0.3.2-py3-none-any.whl
  • Upload date:
  • Size: 18.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.0.post20201006 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.3

File hashes

Hashes for ascheck-0.0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 0c4ff65aab9233f119af80a1ac9a725aaa7cdb1eb758c5ee4fe87d9fa4bcc79f
MD5 15b4d0687128989d71b5e2871bfa2c88
BLAKE2b-256 b511513eac058e42d5f69883c05aacb12f96337ae21637b1079a3c2970f73101

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