Page 3 of 3 FirstFirst 123
Results 21 to 25 of 25

Thread: A different approach to scanned image histograms

  1. #21

    Join Date
    Apr 2011
    Location
    Hemel Hempstead, UK
    Posts
    543

    Re: A different approach to scanned image histograms

    Click image for larger version. 

Name:	door - 3.jpg 
Views:	12 
Size:	42.2 KB 
ID:	147999

    Here is is with a scale of 3. Struan, I'm interested in your log function if you'd care to detail it. I think what I have here is an inverse exponential: what I was after was making the dimmest lines bright enough to see but successive lines provide less input. With a scale of 2, the outputs available are 128, 196, 228, 244, 252, 254, and 255 (I think) so anywhere that gets more than seven or eight hits is full brightness. That's extended for larger divisors, and the dimmest lines are proportionally dimmer.

    Nicholas, the brightest part of this image, apart from the white surround, is on the pillars to the right of the door.

    Neil

  2. #22

    Join Date
    Jul 1998
    Location
    Lund, Sweden
    Posts
    2,214

    Re: A different approach to scanned image histograms

    Just take log(1+pixel_value) and rescale so the maximum is at 255.

    This compresses the highlights and expands the shadows, but leaves the spatial structure comprehensible. It doesn't do much that is useful for normal pictorial images, but is used a lot for data (particularly Fourier transforms, where one prominent peak can hide everything else). I found it helpful for quick assessment of the kinds of distributed histograms we're discussing here. It's a toggle control on most image processing packages, so you can quickly switch back and forth.

    I used brute force, changing values to double precision, and then rescaling back to integer/byte. Since you know your wuffums are 8-bit and pre-scaled, you could probably do the log function as a look up table.

  3. #23

    Join Date
    Apr 2011
    Location
    Hemel Hempstead, UK
    Posts
    543

    Re: A different approach to scanned image histograms

    Thanks Struan.

    This version just increments the histogram linearly in the collection phase, then applies the log function in the display phase.

    Using a straight log(10) still leaves the single trace a bit gloomy:

    Click image for larger version. 

Name:	door log 10.jpg 
Views:	12 
Size:	33.5 KB 
ID:	148035

    Adding an offset and scaling the log a little less lifts the black too much:

    Click image for larger version. 

Name:	door - log plus offset.jpg 
Views:	11 
Size:	32.0 KB 
ID:	148036

    So gating out the zero samples seems an improvement:

    Click image for larger version. 

Name:	door log black.jpg 
Views:	13 
Size:	38.2 KB 
ID:	148037


    if brightness[brightptr + x] > 0:
    green = 64 + int(75 * math.log(brightness[brightptr + x] + 1, 10))


    Neil

  4. #24

    Join Date
    Jul 1998
    Location
    Lund, Sweden
    Posts
    2,214

    Re: A different approach to scanned image histograms

    FWIW, I used to use the log scaling a lot more often when applying a universal normalisation. When normalising each histogram separately, there's less need to bring up the shadows, and as you've shown, when overdone it ends up making the overall shape of the data harder to interpret.

    You have a nice tool there. I look forward to downloading a copy :-)

  5. #25

    Join Date
    Apr 2011
    Location
    Hemel Hempstead, UK
    Posts
    543

    Re: A different approach to scanned image histograms

    Thanks. I'm investigating how to write plugins for Gimp; I'll post again once there's something to see.

    Neil

Similar Threads

  1. First scanned 4x5 image
    By Meekyman in forum Image Sharing (LF) & Discussion
    Replies: 2
    Last Post: 2-Feb-2013, 07:49
  2. What is the best approach to getting your work seen
    By Craig Griffiths in forum Business
    Replies: 15
    Last Post: 7-Jan-2012, 12:12
  3. An interesting approach - revolutionary?
    By Norm Buchanan in forum Digital Hardware
    Replies: 23
    Last Post: 29-Dec-2007, 13:30
  4. How to approach galleries?
    By Marek in forum Business
    Replies: 2
    Last Post: 1-Mar-2004, 09:43

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •