Announcement

Collapse
No announcement yet.

Adaptive Threshold

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Requested Adaptive Threshold

    Adaptive Threshold is a better way to convert color or grayscale images to black-and-white (binary). It would be really nice to have in IrfanView for processing photos/scans of documents and books where the lighting was uneven. Specifically, adaptive thresholding decides whether to make a particular pixel black or white based on the local area around the pixel. In contrast, the current "global" thresholding method compares with the average over the whole image. ImageMagick supports adaptive thresholding with their -lat switch). It's the one and only thing I use ImageMagick for. Otherwise, I use IrfanView.

    Here's an example from this academic page on adaptive thresholding.

    Original image:


    Global thresholding:


    Adaptive thresholding (requested):


    (Credit: R. Fisher, S. Perkins, A. Walker and E. Wolfart. at University of Edinborough School of Informatics)
    Last edited by Alex Quinn; 05.12.2009, 06:43 PM.

    #2
    While we wait, try Mehdi's free Fine Threshhold 8bf plugin.
    Its: Belongs to "It"
    It's: Shortened form of "It is"
    ---------------------
    Lose: Fail to keep
    Loose: Not tight

    ---------------------
    Plurals do not require apostrophes

    Comment


      #3
      Originally posted by matera View Post
      While we wait, try Mehdi's free Fine Threshhold 8bf plugin.
      matera, this is an EXCELLENT solution! I downloaded it just now and checked it out on a few images. Its simple to use, yet does what it promises! Special thanks to Mehdi too, for writing it!

      Trust Alex Quinn's issue is solved with this too!

      P.S. Do we really need another Plug-in that does the same thing that Mehdi's does so well???
      Last edited by WellOiledPC; 08.12.2009, 05:28 PM. Reason: To add the P.S.!
      Download IrfanView Help Manual from:
      IrfanView Website - Here
      Sam_Zen's Website - Here
      Author's Website - Here

      Comment


        #4
        Thank you for the reply and the nice suggestion. I tried the finethresh plugin. It's nice to know about, but it doesn't actually do adaptive threshold. Finethresh lets you choose your preferred cut off, but whatever you choose is applied to the whole image. With adaptive threshold, there's a different cut off for every pixel in the image, based on what's around it. I used finetrhesh on the image above and set the slider to a few different values. As you see, it doesn't give the nice crisp result adaptive threshold gives (above).





        Comment


          #5
          Here's one more example. This is from a grainy cell phone photo of a test document. These were all 1600x1200. I scaled them down to 400x300 to post here.

          Original image


          Global threshold, with Finethresh


          Adaptive Threshold, with ImageMagick
          convert input.jpg -colorspace Gray -lat 30x30-3% output.jpg


          Adaptive Threshold plus a 1x1 median filter to despeckle, with ImageMagick
          convert input.jpg -colorspace Gray -lat 30x30-3% -median 1x1 output.jpg

          Comment


            #6
            Quite impressive indeed.
            And you're right about the single Q point of the FineThres
            0.6180339887
            Rest In Peace, Sam!

            Comment

            Working...
            X