-1

I want to compare the performance of various thresholding methods. Literally, I found various thresholding methods are

  • Histogram shape based methods (Ex:- Otsu Method)
  • Clustering based methods
  • Entropy based methods
  • Attribute similarity methods
  • Locally Adaptive Thresholding

I dont know whether python opencv2 has the above mentioned thresholding methods implementation are not. Any other python library has its implementations ?

I found some Links but thats are very basic :-
http://docs.opencv.org/doc/tutorials/imgproc/threshold/threshold.html http://opencvpython.blogspot.in/2013/05/thresholding.html
(Local thresholding, Global thresholding, Adaptive thresholding, binary, binary_inverted etc., only exists in python opencv. Thast I found)

Can anyone help me to implement the above mentioned thresholding types ? Or any idea to accomplish my task ?

Thanks in adnvance...

Thamizh
  • 516
  • 2
  • 5
  • 15

1 Answers1

0

Example for Otsu:

high_thresh, thresh_im = cv2.threshold(im, 0, 255, cv2.THRESH_BINARY + cv2.THRESH_OTSU)
lowThresh = 0.5*high_thresh

You can find other possible flags for the Threshold Function in the documentation. This includes: BINARY, BINARY_INV, TRUNC, TOZERO and TOZERO_INV.

More adaptive Threshold are listed here. Adaptive modes are: ADAPTIVE_THRESH_MEAN_C and ADAPTIVE_THRESH_GAUSSIAN_C.

Otherwise it is usually pretty simple to implement other Threshold Methods using OpenCV.

Mailerdaimon
  • 5,563
  • 2
  • 34
  • 43
  • Thanks for your quick answer. Have you any other thresholding methods examples pls... – Thamizh Jan 31 '14 at 10:57
  • Hai Mailerdaimon, Pls tell me or help me to implement other Threshold Methods using OpenCV... Thats I want. Thanks in advance... – Thamizh Jan 31 '14 at 11:16
  • Yeah.. well, no. If you want someone to programm for you, you can always hire a programmer. This site is about answering questions and not about some people doing free work for you. I gave you some pointers were you can start your research. If you need help with specific problems i am glad to help, but i am not going to do this stuff for you. – Mailerdaimon Jan 31 '14 at 11:59
  • Mailerdaimon, Read the question I have post without judging yourself. I did not ask you to create software source code for me... See : "Can anyone help me to implement the above mentioned thresholding types ? Or any idea to accomplish my task ?". And your answer says clearly you have no stuff because, already I told in my post clearly "I know, Local thresholding, Global thresholding, Adaptive thresholding, binary, binary_inverted etc.,that already exists in python opencv". Please don't think yourself as a genius. Before answering, please read question carefully. Don't argue please. – Thamizh Jan 31 '14 at 12:41
  • "Can anyone help me to implement the above mentioned thresholding types" is clearly asking for code imho... and I showed you how to use Otsu´s Method and between "I found some Links but thats are very basic" and "i know how to use this and that with Python OpenCV already" are worlds. Please consider asking specific questions that make clear what you want if you don´t want people to missunderstand you. Anyway, got luck, im out. – Mailerdaimon Jan 31 '14 at 13:14