473,480 Members | 1,819 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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 5247
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
4419
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
1545
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
2086
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
5010
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
1101
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
4788
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
1436
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
1630
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
1480
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
7037
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6904
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
6730
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
6873
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5321
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4471
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
2990
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1294
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
174
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.