Skip to content
petermr edited this page Jul 11, 2020 · 1 revision

AMIPixelTool

picocli help:

ami pixel --help
Usage: ami pixel [OPTIONS]
Description
===========
Analyzes bitmaps - generally binary, but may be oligochrome.
Creates pixelIslands.

filestore/ctree

The output of pixel can be complex since we may divide in several ways under pdfimages:

  • colour channels
  • pixel islands
  • image processing

This image is:

https://github.com/petermr/ami3/blob/master/src/test/resources/org/contentmine/ami/ \
    battery10/ \
       PMC3463005/ \
         pdfimages/ \
            image.6.2.86_509.389_714/ \
                octree/ \
                    channel.1d1ce2.png

https://github.com/petermr/ami3/blob/master/src/test/resources/org/contentmine/ami/battery10/PMC3463005/pdfimages/image.6.2.86_509.389_714/octree/channel.ce4dd2.png

## processed binary images

https://github.com/petermr/ami3/blob/master/src/test/resources/org/contentmine/ami/battery10/PMC3463005/pdfimages/image.6.2.86_509.389_714/octree/channel.1d1ce2.png.thin.png

https://github.com/petermr/ami3/blob/master/src/test/resources/org/contentmine/ami/battery10/PMC3463005/pdfimages/image.6.2.86_509.389_714/octree/channel.ce4dd2.png.thin.png

pixel islands

channel.1d1ce2.png.island_1_726.png https://github.com/petermr/ami3/blob/master/src/test/resources/org/contentmine/ami/battery10/PMC3463005/pdfimages/image.6.2.86_509.389_714/octree/channel.1d1ce2.png.island_1_726.png

svg output

battery10/PMC3463005/pdfimages/image.6.2.86_509.389_714/octree/channel.1d1ce2.png.volt.svg

https://github.com/petermr/ami3/blob/master/src/test/resources/org/contentmine/ami/battery10/PMC3463005/pdfimages/image.6.2.86_509.389_714/octree/channel.1d1ce2.png.volt.svg

<?xml version="1.0" encoding="UTF-8"?>
<svg height="337.5" width="770.5" xmlns="http://www.w3.org/2000/svg">
 <g>
  <g>
   <rect x="596.0" y="101.0" width="1.0" height="1.0" style="fill:magenta;stroke:none;"/>
   <rect x="597.0" y="101.0" width="1.0" height="1.0" style="fill:magenta;stroke:none;"/>
   <rect x="596.0" y="102.0" width="1.0" height="1.0" style="fill:magenta;stroke:none;"/>
   <rect x="595.0" y="102.0" width="1.0" height="1.0" style="fill:magenta;stroke:none;"/>
   <rect x="598.0" y="101.0" width="1.0" height="1.0" style="fill:magenta;stroke:none;"/>
   <rect x="595.0" y="103.0" width="1.0" height="1.0" style="fill:magenta;stroke:none;"/>
   <rect x="599.0" y="101.0" width="1.0" height="1.0" style="fill:magenta;stroke:none;"/>
   <rect x="595.0" y="104.0" width="1.0" height="1.0" style="fill:magenta;stroke:none;"/>

picocli options

Options
=======
      --filename=<basename>
                          name for transformed Imagefile
                            Default: default
  -h, --help              Show this help message and exit.
      --islands=<maxIslandCount>
                          create pixelIslands and tabulate properties of first $maxIslandCount islands sorted by size.0
                            means no anaysis.
                            Default: 10
      --lineLengths=<lineLengths> <lineLengths>
                           minlength and maxlength. Units with integers are absolute. maxLength will depend on
                            scalingso use carefully. Default 100 9999
                            Default: [100, 9999]
      --lines             extract lines from projections. Result is set of lines in SVGLine format. use --lineLengths
                            for control
      --maxislands=<maxislands>
                          maximum number of pixelIslands. Only use if the original is 'too spotty' and taking far too
                            long. The output is truncated.
                            Default: 500
      --mingap=<mingap>   minimum number of pixels separating islands or lines. Only currently for lines. two lines
                            separated by < mingap will be joined, so mingap=1 means all disjoint objects areretained.
                            mingap=2 will join lines (2,8) and (10,20) to create (2,20)
                            Default: 1
      --minheight=<minheight>
                          minimum height range for islands
                            Default: 30
      --minwidth=<minwidth>
                          minimum width for islands
                            Default: 30
      --outputDirectory=<outputDirname>
                          subdirectory for output of pixel analysis and diagrams (if none defaults to <inputBasename>)
      --overlap           try to untangle overlaps
      --projections       project pixels onto both axes. Results are IntArrays with frequency ofblack pixels
      --projectionsname=<projectionsName>
                          name for holding extracted projections
                            Default: projections
      --removelines=<removeLinesFilename>
                          file with lines to remove; will trace through image removing pixels where line overlaps. NYI
      --rings=<minRingCount>
                          create pixelRings and tabulate properties. Islands are only analyzed if they have more than
                            minRingCount. Default (negative) means analyze none. 0 means all islands. Only '--islands'
                            count are analyzed
                            Default: -1
      --subimage=<subimageTokens>...
                          create a subimage and extract projections  '--subimage statascale ycoord 2 10 xprojection'
                            means:     use statascale protocol 2nd y horizntal line and add 10 pixels and project onto
                            x. Horrible kludge. The first token is the name, the others are more hacky. Will try to
                            replace by creating actual subimages.
                            Default: []
      --templateinput=<templateInput>
                          generate template from pixel projections; triggers the activity; normally
                            some/where/projections.xml
      --templateoutput=<templateOutput>
                          filename of generated template file
                            Default: template.xml
      --templatexsl=<templateXsl>
                          stylesheet for generating individual templates. located in src/main/resources, normally
                            accessed as resource /org/contentmine/ami/tools/foo.xsl
      --thinning=<thinningName>
                          Apply thinning () (none, or absence -> no thinning)
                            Default: none
  -V, --version           Print version information and exit.
      --xprojection=<xProjectionFactor>
                          fraction of height for meaningful projection. If greater will contribute to a projection
                            range.When extracting lines may need to be 1.0
                            Default: 0.5
      --yprojection=<yProjectionFactor>
                          fraction of width for meaningful projection. If greater will contribute to a projection range
                            Default: 0.5

Clone this wiki locally