find-cut-up-regions
Hypothesis
We hypothesize that it is possible to use Pillow to find "sensible" regions of an image to use in a cut-up construction.
Apparatus
- Python 2.7.6 (probably works with older versions too)
- Pillow (it might work with PIL too)
- Some scanned images of newspapers, books, etc.
Method
- First, decide what makes a pixel "light" versus "dark".
- Crop (say 5%) off the edges of the image to account for scanner darkness.
- For each horizontal line of pixels in the image, if some percentage (say 90%) of the pixels are "light", record this line.
- Amalgamate adjacent recorded lines and possibly reduce their thickness.
- Strips to cut will be those between the lines.
- Then, for each strip, rotate it 90 degrees and run in through the above process (as if it were an entire input image), rotating the generated "strips" from that back -90 degrees.
Observations
So far, so good.
History of
find-cut-up-regions
@master
git clone https://git.catseye.tc/NaNoGenLab/
- Allow scaling the input pages all to the same size. Chris Pressey 11 years ago
- Downscale illustrations and float them or centre them. Chris Pressey 11 years ago
- Organize into fewer output directories and deal with black bars. Chris Pressey 11 years ago
- Why does scientific progress always come with annoying black bars?? Chris Pressey 11 years ago
- Oh, Bumble! You have fumbled! bool('False') == True! Chris Pressey 11 years ago
- Process multiple files and save snippings in own dir for each. Chris Pressey 11 years ago
- Add --debug option, lower contrast level for better(?) results. Chris Pressey 11 years ago
- Definitely showing promise, but needs a --debug option I think. Chris Pressey 11 years ago
- Import checkpoint of find-cut-up-regions. Showing promise. Chris Pressey 11 years ago