473,909 Members | 6,117 Online
Bytes | Software Development & Data Engineering Community
+ 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 5265
On Jun 5, 10:19 am, azrael <jura.gro...@gm ail.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...@g mail.comwrote:
On Jun 5, 10:19 am, azrael <jura.gro...@gm ail.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...@gm ail.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.or g/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...@g mail.comwrote:
On Jun 5, 10:19 am, azrael <jura.gro...@gm ail.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
4455
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: row:0->height column:0->width
8
1563
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 within a threshold. So far I have tested the following however it is very slow.
1
2118
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 at 100%, and so far over the last 18 hours I have only gotten one email about it. Is there a way to adjust the frequency of the threshold check? I am aware of the sensitivity setting, and we have that at 0. Thanks, rdudejr
18
5055
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 there are NO indexes on the table. However, when we index email the query takes forever. FACTS - The problem is very "data specific". I can not recreate the
0
1116
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 how to find the threshold of a colour so that i can specify it in the CANNY's algorithm to detect the edge of the area filled wit a particular colour?
15
4831
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 ncurses. But as far as I can tell, it is not available for Python on Windows? Is there a workaround? Or are there alternative libraries that might be used instead of (n)curses? I know I can use (n)curses on *nix and console on Windows etc., but...
0
1465
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 connected currently in the database >>>>> Percent applications in the database that are waiting on locks >>>>> Maximum number of associated agents >>>>> Stolen agents in the instance >>>>> Stolen agents in an application >>>>> Maximum number...
2
1668
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 utility which I wrote myself and which crawls through a directory comparing all possible pairs of files. Under Windows it works fine, while the same code under Linux (Fedora Core 3) works for a while then starts continuously throwing up the following...
4
1495
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 string that this list was derived from and replace selections in this text string with those from my list. So in my text string, '... and the... ' becomes ' ... and_the...'. I can't figure out how to manipulate re.sub(r'(*) (*)', r'(????)',...
0
9877
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11346
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10919
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10538
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
8097
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7248
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4774
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 we have to send another system
2
4336
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3357
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.