Fred's ImageMagick Scripts



    Licensing:

    Copyright © Fred Weinhaus

    My scripts are available free of charge for non-commercial use, ONLY.

    For use of my scripts in commercial (for-profit) environments or non-free applications, please contact me (Fred Weinhaus) for licensing arrangements. My email address is fmw at alink dot net.

    If you: 1) redistribute, 2) incorporate any of these scripts into other free applications or 3) reprogram them in another scripting language, then you must contact me for permission, especially if the result might be used in a commercial or for-profit environment.

    Usage, whether stated or not in the script, is restricted to the above licensing arrangements. It is also subject, in a subordinate manner, to the ImageMagick license, which can be found at: http://www.imagemagick.org/script/license.php

THRESHOLD COMPARISON STUDY


The following techniques are compared:

  • 2 Color Adaptive Spatial Subdivision Color Reduction
  • Otsu's Between Class Variance
  • Isodata
  • K-Means
  • Fuzzy C-Means
  • Kapur's Entropy
  • Sahoo's Entropy (power=2)
  • Sahoo's Entropy (power=0.1)
  • Triangle Method
  • Local Adaptive (Mean Plus Offset)

Pictures Were Obtained from:

blood.jpg from http://www.istanbul.edu.tr/eng/ee/jeee/main/pages/issues/is62/62008.pdf
fingerprint.jpg from http://www.istanbul.edu.tr/eng/ee/jeee/main/pages/issues/is62/62008.pdf
flower.jpg from http://www.jhlabs.com/ip/blurring.html
house.jpg from http://en.wikipedia.org/wiki/Otsu's_method
kanji.jpg from http://www.measurement.sk/2004/S1/Yong.pdf
lena2g_edge1.jpg was created using the IM function -edge 1 parts.gif from http://www.ph.tn.tudelft.nl/Courses/FIP/noframes/fip-Segmenta.html
rice.jpg from http://www.istanbul.edu.tr/eng/ee/jeee/main/pages/issues/is62/62008.pdf
tank.jpg from http://stinet.dtic.mil/cgi-bin/GetTRDoc?AD=ADA464347&Location=U2&doc=GetTRDoc.pdf
textsample.jpg from http://signal.ece.utexas.edu/seminars/dsp_seminars/01fall/211_seeger_mf.pdf

My rankings are based solely on visual inspection and personal preferences.



Original Image

2 Color

Otsu BCV

Isodata

K-Means

Fuzzy C-Means

Kapur Entropy

Sahoo Entropy P=2

Sahoo Entropy P=0.1

Triangle Method

Local Adaptive

RESULTS

Not Processed
(Not Applicable?)

Best: Fuzzy C-Means
Close Seconds:
Triangle
Sahoo P=2


Original Image

2 Color

Otsu BCV

Isodata

K-Means

Fuzzy C-Means

Kapur Entropy

Sahoo Entropy P=2

Sahoo Entropy P=0.1

Triangle Method

Local Adaptive

RESULTS

Not Processed
(Not Applicable?)

Close Tie:
2 Color
Otsu BCV
Isodata
K-Means
Fuzzy C-Means


Original Image

2 Color

Otsu BCV

Isodata

K-Means

Fuzzy C-Means

Kapur Entropy

Sahoo Entropy P=2

Sahoo Entropy P=0.1

Triangle Method

Local Adaptive

RESULTS

Not Processed
(Not Applicable?)

Close Tie:
2 Color
Otsu BCV
Isodata
K-Means
Fuzzy C-Means
Kapur Entropy
Sahoo Entropy P=0.1


Original Image

2 Color

Otsu BCV

Isodata

K-Means

Fuzzy C-Means

Kapur Entropy

Sahoo Entropy P=2

Sahoo Entropy P=0.1

Triangle Method

Local Adaptive

RESULTS

Not Processed
(Not Applicable?)

Best: 2 Color
Close Seconds:
Otsu BCV
Isodata
K-Means


Original Image

2 Color

Otsu BCV

Isodata

K-Means

Fuzzy C-Means

Kapur Entropy

Sahoo Entropy P=2

Sahoo Entropy P=0.1

Triangle Method

Local Adaptive

RESULTS

Not Processed
(Not Applicable?)

Best: Sahoo Entropy P=0.1
Close Seconds:
Sahoo Entropy P=2
Kapur Entropy
Fuzzy C-Means


Original Image

2 Color

Otsu BCV

Isodata

K-Means

Fuzzy C-Means Radius=30

Kapur Entropy

Sahoo Entropy P=2

Sahoo Entropy P=0.1

Triangle Method

Local Adaptive

RESULTS

Not Processed
(Not Applicable?)

Close Tie:
2 Color
Otsu BCV
Isodata
K-Means
Sahoo Entropy P=0.1
Close Second:
Fuzzy C-Means Radius=30


Original Image

2 Color

Otsu BCV

Isodata

K-Means

Fuzzy C-Means Radius=3

Kapur Entropy

Sahoo Entropy P=2

Sahoo Entropy P=0.1

Triangle Method

Local Adaptive

RESULTS

Tie: Local Adaptive
Fuzzy C-Means Radius=3
Close Seconds:
2 Color
Otsu BCV
Isodata
K-Means
Kapur Entropy


Original Image

2 Color

Otsu BCV

Isodata

K-Means

Fuzzy C-Means

Kapur Entropy

Sahoo Entropy P=2

Sahoo Entropy P=0.1

Triangle Method

Local Adaptive

RESULTS

Close Tie:
2 Color
Otsu BCV
Isodata
K-Means
Sahoo Entropy P=0.1
Close Seconds:
Fuzzy C-Means
Triangle Method


Original Image

2 Color

Otsu BCV

Isodata

K-Means

Fuzzy C-Means

Kapur Entropy

Sahoo Entropy P=2

Sahoo Entropy P=0.1

Triangle Method

Local Adaptive

RESULTS

Best: Local Adaptive
Close Seconds:
Triangle Method
Sahoo Entropy P=2
Fuzzy C-Means Radius=10


Original Image

2 Color

Otsu BCV

Isodata

K-Means

Fuzzy C-Means

Kapur Entropy

Sahoo Entropy P=2

Sahoo Entropy P=0.1

Triangle Method

Local Adaptive

RESULTS

Not Processed
(Not Applicable?)

Close Tie:
Otsu BCV
Isodata
K-Means
Triangle Method


Original Image

2 Color

Otsu BCV

Isodata

K-Means

Fuzzy C-Means

Kapur Entropy

Sahoo Entropy P=2

Sahoo Entropy P=0.1

Triangle Method

Local Adaptive

RESULTS

Best: Local Adaptive


Summary Of Rankings

11 Images

2
Color

Otsu
BCV

Isodata

K-Means

Fuzzy
C-Means

Kapur
Entropy

Sahoo
Entropy
P=2

Sahoo
Entropy
P=0.1

Triangle
Method

Local
Adaptive

Number Of
First Places

5

5

5

5

4

1

0

4

1

3

Number Of
Second Places

1

2

2

2

4

2

3

0

2

1

Number Of
Either Places

6

7

7

7

8

3

3

4

3

4



Conclusion: No One Method Is Universally Best

(as if we already did not know that)