comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Curve Fitting Question
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Otsu Threshold for Bimodal Data [message #82274 is a reply to message #82169] Sat, 24 November 2012 09:20 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
David Fanning writes:

> The OTSU_THRESHOLD program Gianguido mentions above makes
> a number of undocumented assumptions that can cause problems
> in the real-world use of the program. In my first attempt
> at implementing this algorithm I inadvertently copied all
> those dangerous assumptions into my own cgOtsu_Threshold
> program.
>
> In particular, this Otsu_Threshold program assumes you
> are working with byte type images and that your binsize
> is 1. It returns erroneous thresholds if you are working with
> real data outside the range 0 to 255 or using bin sizes
> other than 1.
>
> Since I work with both these conditions often in effect,
> I needed a more robust algorithm. Today I found a great
> web page that allowed me to rebuild the algorithm from
> the ground floor up.

The new algorithm turned out to be not quite as robust
as I expected it to be. But, good news, this turned out
to be due to a faulty assumption on my part and not to
a failure of the algorithm. In particular, the program
was having problems dealing with integer data.

My fault entirely. I assumed an equation I was using with
the threshold values was converting the threshold values
to floats. It was not. Once this problem was solved, the
algorithm is again acting like a champ!

http://www.idlcoyote.com/programs/cgotsu_threshold.pro

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Using TexToIDL in Coyote Graphics Routines
Next Topic: printf within time interval (also posted on exelisvis.com)

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 10:07:27 PDT 2025

Total time taken to generate the page: 0.72028 seconds