473,237 Members | 1,250 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,237 software developers and data experts.

otsu threshold in python

Hy guys.
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.

Thanks

Jun 5 '07 #1
3 5237
On Jun 5, 10:19 am, azrael <jura.gro...@gmail.comwrote:
Hy guys.
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.

Thanks
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
task?

I would ask exactly what problems you're running into, but:
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.
How do you know you need it? Did you learn about this in class? And
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/CV.../threshold.pdf
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.

Hyuga

Jun 5 '07 #2
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
object.
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
implemented it.

Thanks Hyuga

On Jun 5, 6:02 pm, Hyuga <hyugaricd...@gmail.comwrote:
On Jun 5, 10:19 am, azrael <jura.gro...@gmail.comwrote:
Hy guys.
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.
Thanks

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
task?

I would ask exactly what problems you're running into, but:
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.

How do you know you need it? Did you learn about this in class? And
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/CV.../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.

Hyuga

Jun 6 '07 #3
On Jun 6, 7:49 am, azrael <jura.gro...@gmail.comwrote:
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
object.
So I learned from the PDF I linked you to. Take a good look at it.
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.
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
implemented it.

Thanks Hyuga

On Jun 5, 6:02 pm, Hyuga <hyugaricd...@gmail.comwrote:
On Jun 5, 10:19 am, azrael <jura.gro...@gmail.comwrote:
Hy guys.
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.
Thanks
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
task?
I would ask exactly what problems you're running into, but:
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.
How do you know you need it? Did you learn about this in class? And
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/CV.../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.
Hyuga

Jun 6 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Raj | last post by:
Hello Members, I wrote a program to convert a greyscale bitmap image in to monochrome bitmap image, a simple thresholding. Input:Greyscale image; Expected Output:Monochrome image Pseudocode:...
8
by: bevanward | last post by:
Hi all I have a large data set of points situated in 3d space. I have a simple primary key and an x, y and z value. What I would like is an efficient method for finding the group of points...
1
by: rdudejr | last post by:
How often does the health monitor check the threshold of an indicator to see if there is a warning or alarm? I am trying to simulate the behaviour of the health monitor and have a dms tablespace...
18
by: Dave | last post by:
Guys I am really stuck on this one. Any help or suggestions would be appreciated. We have a large table which seemed to just hit some kind of threshold. They query is somewhat responsive when...
0
by: nandana | last post by:
hello... Am doing a project on image processing, and using CANNY's edge detection algorithm to detect the edge of an activity centre in a FMRI image of the human brain. Can someone pls tell me...
15
by: pinkfloydhomer | last post by:
I need to develop a cross-platform text-mode application. I would like to do it in Python and I would like to use a mature text-mode library for the UI stuff. The obvious choice, I thought, was...
0
by: kavin | last post by:
Hi im having a list of db2 monitoring metrics but i have some confusions in setting the threshold levels.. can any one give me the threshold levels for the below mensioned mertics Applications...
2
by: peter | last post by:
I'm not sure if this query should be directed to comp.lang.python or comp.os.linux.misc so I intend to post it to both with apologies if it's inappropriate on either. I have a small python...
4
by: charonzen | last post by:
I have a list of strings. These strings are previously selected bigrams with underscores between them ('and_the', 'nothing_given', and so on). I need to write a regex that will read another text...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.