4.46154

4.5 | 13 ratings Rate this file 156 downloads (last 30 days) File Size: 144.44 KB File ID: #8647

Local Adaptive Thresholding

by Guanglei Xiong

 

05 Oct 2005 (Updated 13 Jun 2006)

No BSD License  

Threshold with local statistics, such as mean or median.

Download Now | Watch this File

File Information
Description

ADAPTIVETHRESHOLD An adaptive thresholding algorithm that seperates the foreground from the background with nonuniform illumination.
  bw=adaptivethreshold(IM,ws,C) outputs a binary image bw with the local threshold mean-C or median-C to the image IM.

ws is the local window size.

tm is 0 or 1, a switch between mean and median. tm=0 mean(default); tm=1 median.

Contributed by Guanglei Xiong (xgl99@mails.tsinghua.edu.cn) at Tsinghua University, Beijing, China.

For more information, please see
  http://homepages.inf.ed.ac.uk/rbf/HIPR2/adpthrsh.htm

Required Products Image Processing Toolbox
MATLAB release MATLAB 7.0.4 (R14SP2)
Zip File Content  
Other Files adaptivethreshold/adaptivethreshold.m,
adaptivethreshold/page.png,
adaptivethreshold/testadaptivethreshold.m,
adaptivethreshold/tshape.png
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (17)
07 Nov 2005 J. Zhou

Pretty cool results with flexible options.
Great job!

22 Mar 2006 tester Mc tester

it didnt work!!
i get
Error using ==> mat2gray
A must be double

26 Apr 2006 Alan Zhang

The 2 lines near the end should be changed from:
sIM=mIM-IM;
bw=im2bw(sIM,C);
to:
sIM=mIM-IM-C;
bw=im2bw(sIM,0);
This change allows C to be +ve and negative. In the old code bw=im2bw(sIM,C) causes error when C is -ve.

31 Jan 2007 Piyorot Khongchuay

cool

06 Mar 2007 saravanan kumar

nice work

24 Jun 2007 amit vishnipolsky  
30 Jul 2007 mel tem

thank you

19 Sep 2007 saravanan radhakrishnan

really good code

09 Oct 2007 kayalvizhi lakshmanan  
24 Mar 2008 ranjeeth dasineni

works great man!!

01 Apr 2008 zhang shi jie

really nice

10 Apr 2008 alev soke

thank you very much.
it is a perfect program.

29 Apr 2008 Guillermo Moreno

Simple and Fast, thanks

21 Jul 2008 hafid rafi

it's very very simple thanks

05 Sep 2009 sanjay bhattacharya

Nice code, but not applicable in extreme situations.

05 Sep 2009 sanjay bhattacharya

I have written a code without using any std functions like imfilter etc, its purely based on fundamentals.

CHECK OUT THE OUTPUT IMAGES
http://sites.google.com/site/adapthresh/

05 Sep 2009 sanjay bhattacharya

it can detect the letters even where its very dark (see the lines in the end) line 8 etc

Please login to add a comment or rating.
Updates
07 Oct 2005

remove unnecessary Thumbs.db in zip file

13 Jun 2006

Thanks, Alan Zhang! I follow your advice.

Tag Activity for this File
Tag Applied By Date/Time
filtering Guanglei Xiong 22 Oct 2008 08:01:56
threshold adaptive local Guanglei Xiong 22 Oct 2008 08:01:56
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com