Package: ascheck
AScheckThis script can easily load and perform calculations on a directory of
images.Functionality can be added to thecore.ascheck.Imageclass. This can
then be called from theascheckscript.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.InstallationUsing pipascheckis available onPyPI, install usingpip install ascheck --upgradeAfter installing, simply open a terminal and type the following commandascheckGithubThe 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 installAfter installing, simply open a terminal and type the following commandascheckUsageAfter installing the package, you should be able to run it from
anywhere within the terminalA dialog will open asking you for the folder that contains your
images.Choose the folder and the program will ask some questions: do you want
to compute the asymmetry?Optionally, diagnostic images can also be saved to check whether
anything went wrong in the automatic object detection.We also ask whether you want to compute the slicesand how manyagain, with optional diagnostics.OutputsThe asymmetry calculation creates a folderbw/in the selected
folder where it saves the black and white outlines and it will save
the asymmetry indices in a file calledascheck_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 pixelsimage_name_contour.ext: grayscale image with the contour filled in redThe object widths calculation creates a folderslices/in the
selected folder where it saves.csvfiles 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 inimage_name_slices.ext: grayscale image with contour filled in red,
the central intervals indicated with crosses, and the intersections
with dots.ExampleWe start out with the image of a biface.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.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.Computing the intervals along the longest axis, the intersections with
the contour can then be found.IssuesThe 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.