Giter VIP home page Giter VIP logo

quack's Introduction

Quack

An enhanced ALTO-viewer for Quality Assurance oriented display of a collections of scans, typically from books or newspapers.

Please visit http://tokee.github.io/quack/ for the project homepage, featuring a live demo.

Quack screenshot 20131127

Requirements

  • A minimum of 2GB free RAM for processing of 30MP scans
  • bash
  • GraphicsMagic
  • ImageMagick (as GraphicsMagic cannot create histograms)
  • openseadragon.min.js
  • A suitable beefy browser equipped machine for display, depending on image sizes and ALTO complexity
  • deepzoom (only if tile based display is enabled. Install with 'sudo cpan -f install Graphics::DZI')
  • Perl (required by deepzoom)

Usage

To get started, execute the following in a terminal (Tested under Linux, should work under OS-X and Cygwin):

./quack.sh samples samples_out

quack's People

Contributors

tokee avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

quack's Issues

Performance statistics

For future optimization it would be interesting to measure the amount of time used on the different part of the processing chain. Time spend on generating tiles, time spend analyzing ALTO etc.

Avoid memory overhead for histogram

The histogram function in ImageMagic is extremely memory hungry (~1GB of RAM for a 30MP image). Unfortunately it seems that GraphicsMagic is equally needy, but it should be possible to find a generic, fast and low-mem way of generating histograms from greyscale images.

Count holes in the histogram

Absolute holes (greyscale intensities with count 0) are strong indicators of post-processing. They are easy to find and counting those would make it easy to detect post-processing.

Smarter histogram generation

ImageMagic's histogram generator uses an insane amount of memory: 2GB for a 30MP image. A helper bash script has been implemented (analyze.sh) for experimentation but although it uses a lot less RAM, it is very slow.

sed command in quack.sh not working on OS X 10.9

The sed command called from quack.sh does not work in OS X 10.9 and older versions too I suspect - as OS X sed handles the -i argument (and other arguments) differently to the Linux version.

A quick work around is to use gnu-sed on OS X.

The long term solution is to fix the script to run on both Unix variants.

Fussy dark percentage is off

It seems that the dark percentage is off when more than just grey(0) is counted. This is possibly triggered by generating all parts, then changing the dark fuzzy-factor and re-generating.

The grey statistics is always based on the full image

The histogram can optionally be calculated based on a sub part of the image (typically one would want that when there are black borders which will otherwise shew the numbers). The printed statistics should also be based on the crop.

Blown blacks overlay is not transparent

With Graphics Magick 1.3.18 2013-03-10 Q8 (default install under Ubuntu 14.04), the overlay files for blown blacks are not made transparent. Running quack.sh results in errors like

gm convert: Invalid background palette index (/home/te/projects/quack/t1/sub/ACE-17950616-0019A.black.png).

Sometimes overlays are not created

There seems to be a timing issue when an image page is opened in a browser. With Firefox at least, opening a page with a large image and moving the mouse over the image before the tiles are fully loaded in OpenSeadragon, sometimes stops the overlay setup.

Show selected stats in folder view

Holes in histograms, spike height, burnout percent and OCR recognition rate are candidates for stats where an overview would help a lot.

Show holes in the histogram values list

The greyscale intensities and their counts are shown at the bottom of the pages. Showing and marking missing values makes it easier to judge whether they are a problem.

Sometimes overlay generation produces faulty images

User @kaarefc reported the error message "gm convert: Invalid
background palette index (/home/kfc/public_html/kfc/PDF_Batch01-3/A-1999-11-08-P-0482.white.png)" when processing images. A quick investigation showed that the transparent pixels of the generated overlay were not transparent but white.

Visualize histogram cropping

Specifying a crop percentage is essential for generating usable histograms and histogram statistics, when the source image has been rotated. However, this cropping is not shown anywhere, which raises the question as to what part of the image the histogram really represents.

A simple box (maybe shown only on mouse-over on the histogram?) showing the crop area would be one solution.

Aggregated greyscale statistics

At any given level of the folder tree, it would be interesting to know the top X darkest and top Y brightest images.

The numbers for the individual images are already there as .grey-files, they just needs to be collected.

The histogram values sometimes contain colormap data

The grep for histogram data is faulty and adds some colormap data if there are less than 256 greyscale values.

This should be fairly trivial to fix with a check for colormap and a subsequent length cut with head.

Presentation images should be optional

As the presentation images imposes quite an extra load on the browser, takes up storage space and are not always needed or even wanted, they should be optional.

Speed up HTML generation

Biggest problems are text iteration with processing and HTML generation with templating through bash. This really isn't bash's forte.

Correct handling of hyphenated words

In the ALTO format, hyphenated words, broken over two lines, can be stated by explicit duplication in the form of the parts + the whole. The current text extractor extracts everything, resulting in confusing OCR display for the duplicate case. This should be collapsed to just the full word, including the hyphenation-char.

HTML-snippets in folders

It should be possible to have custom HTML-snippets placed in image-folders inserted into the generated pages. This would make it possible to have descriptive meta-data stored with the sources.

All images overview page

A single page with all images from all sub folders can be easier to handle than a deep directory structure. This page could be generated for all projects and accessed with a link from the standard pages.

One problem is that the Previous and Next links on the image pages would have little relation to the image order on the overview page, but that problem is already present when sorting the image list on a folder page.

Progress tracker works poorly with updates

When new ALTO-image-pairs has arrived and Quack is re-executed, progress is tracked against all potential images instead of the ones that has not been processed yet. Quack should start by estimating how many images has already been processed.

Add shortcuts for display adjustments

Switching between thumbnails & histograms in the folder view and toggling overlays in image view should be accessible by keyboard shortcuts for faster inspection.

Optional fixed histogram scale

Currently all histograms are vertically scaled to the maximum count. Comparing histograms between images is hard with such scaling. One possibility would be to set a fixed height for the histogram, in terms of percentage of the total pixels.

In addition to the fixed histogram, the standard non-fixed could also be generated, but only be shown on mouse-over.

The indicator for next segment is confusion

When the user points to a segment, the next segment in the group is marked with a surrounding box. This is highly confusing as the expectation is that something happens to the element pointed to. @kaarefc suggests marking both the current and the following box.

Better handling of aborted execution

If a Quack-execution is aborted, it sometimes leaves zero-length files. Checks for file existence is currently with bash '-f', which simply checks for existence. The check '-s' checks for existence of a file of length > 0 and would be better in this situation.

The templating system always inserts a newline

Some of the variable substitutions are single-value and does not work well when a newline is added to the inserted value. GREY_PERCENT_FIRST is an example of this.

It should be possible to avoid the newline.

Spikes should not be black or white

With burnout, both dark and light, the spike will very often be the same as one of the burnouts. Spike search should skip the outer edges of the histogram, in order to produce a third interesting measurement.

Better progress status

When processing folders or files, some sort of progress indicator would be preferable. Maybe the current image count vs. the total image count?

This does not help locally to a folder, so maybe quack should start by counting all images? Remember that image conversion is threaded, so beware updating the counter.

Changing sort order in table should change thumbnail order too

The table with links to image pages in the folder view supports sorting by any column. This should be linked to the thumbnails so that their order matches the table at all time.

Idea for implementation: Add a hook for clicks on table header, step through the list. For each entry, remove its thumbnail-div from the thumbnail outer box and insert it again as the last element. Do the same for thumbnails.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.