tokee / nrtmosaic

Fast mosaic creation from pre-processed source images
Apache License 2.0
3 stars 0 forks source link

Contrast-reduced Pyramid selection #19

Open tokee opened 8 years ago

tokee commented 8 years ago

The typical greyscale newspaper page has a histogram with some black/dark-grey and a lot of near-white:

             *
             *
             *
             *
             *
  **         *
 *****      **
****************

This means that the average for the whole page will be around light-grey for most of the pages. As each pixel on a page is to be paired up with a fitting average for another page, this means that there are few candidates around the two intensities that has few pixels: Dark-grey and light-grey. A histogram of the averages of a 1000 pages sample looks roughly like this:


      *****
    *********
  ************

The use of dynamic filling (see issue #18) extends the amount of candidates, but still the visual result has poor contrast, especially for dark-grey areas found in some images.

Perhaps the selection of Pyramids could be done using a formula, that squashes the range 0-255 into a tighter range, that better matches the histogram for the averages? The transformed mapping-pixels would then form this histogram:

           *
           *
           *
           *
      *    *
      *    *
     **** **
   ***********

Together with dynamic fills extending the amount of candidates, this should make it possible to adequately represent the transformed pixels. It would result in a lower contrast image, but the different greys within the range would be more distinct.