Python Programming Language
otsu threshold in python
I'd like to ask you for a favour.
I tried several times to implement the otsu threshold filter in
python. but I failed every time. I found the soucre code i n Java from
the ImageJ project but I never worked in Java and there have been used
some built in Java functions which I don't know how they behave. I
also found the otsu threshold in the ia636 python module and would
like only this filter and don't want to import this library.
Is there anyone who wold like to help me. I need a function that takes
a list of 256 elements as an argument and returns the threshold values
for the threshold according to Otsu.
In addvance, I don't expect someone to do my homework. I really tried
it, I have been googling and didn't find a standalone function. I
wasn't able write a standalone function because I don't understand the
Otsu method. I just know that it works well and that I need it.
If there is no one that wants to help me with this problem, can
someone at least explain me in a detailed way how to implement it.
On Jun 5, 10:19 am, azrael <firstname.lastname@example.org> wrote:
What is the whole assignment meant to accomplish? Is the assignment
to implement the Otsu method? If so, you shouldn't be trying to find
library functions. Or is it just something you need for some larger
I would ask exactly what problems you're running into, but:
> it, I have been googling and didn't find a standalone function. I How do you know you need it? Did you learn about this in class? And
> wasn't able write a standalone function because I don't understand the
> Otsu method. I just know that it works well and that I need it.
if so, are you expected to understand it?
I've never even heard of it, but I googled it, and found the fourth
hit pretty good: http://homepages.inf.ed.ac.uk/rbf/CVonline/LOCAL_COPIES/MORSE/thresho...
This gives a reasonable explanation. I couldn't tell you *exactly*
why it works, but it's understandable enough from that that I can see
that it should work, and to see how to implement it.
Not to mention that the above PDF basically *gives* you the
implementation for free (just make sure not to miss the recurrence
relations at the end of the section on the Otsu method, or else you'll
be screwing yourself).
So give that a look and see if it helps.
the otsu filter is a filter that takes a image and from its histogram
calculates the values at which the image should be thresholded to
acomplish an optimal seperation of a foregtround and background
I didn't hear about, but I used it through the ImageJ tool. It gave me
optimal results. I'm working on a project for my clases, and the last
thing I need to accomplish my goal is this filter. Is there anyone who
On Jun 5, 6:02 pm, Hyuga <email@example.com> wrote:
On Jun 6, 7:49 am, azrael <firstname.lastname@example.org> wrote:
> the otsu filter is a filter that takes a image and from its histogram So I learned from the PDF I linked you to. Take a good look at it.
> calculates the values at which the image should be thresholded to
> acomplish an optimal seperation of a foregtround and background
The equation is fairly simple to begin with, and the paper shows how
to simplify the calculation quite a bit.
Also, the Wikipedia article at http://en.wikipedia.org/wiki/Otsu's_method
even gives a simple pseudo-code implementation. I've tried it myself
in Python, and it seems give good results.