I need to segment an object from background. As the starting point I assume there is a single object in the image and my task is to separate it from the background and create a binary image ( 0 -for background and 1 - for object). I read some stack overflow questions and research papers about segmentation using threshold. I have found two ways, global threshold and local/adaptive threshold. We can apply them under various conditions i.e. global threshold may be suitable for one case but may not be suitable for other case. My question is given an image how we can automatically find the most appropriate method. Is it always suitable to use local threshold approach instead global as a precaution?
Asked
Active
Viewed 186 times
-2
-
1I think it is better to tell reasons before downgrading the question. Then we can learn our mistakes – Chamath Sajeewa Oct 23 '14 at 02:13
1 Answers
3
Here is a quote from the abstract of a paper which I think would answer your question:
In images with uniform contrast distribution of background and foreground like document images, global thresholding is more appropriate. In degraded document images, where considerable background noise or variation in contrast and illumination exists, there exists many pixels that cannot be easily classified as foreground or background. In such cases, binarization with local thresholding is more appropriate.
Reference: click me
If something is unclear please ask for clarification :)
-
2Spot on. Use global thresholding when you have a very simple case, such as an object with relatively high contrast on a dark background. For things such as document scanning I would definitely use local thresholding as you want to ensure that all of the text appears, regardless of the illumination and contrast in local areas. +1 btw! – rayryeng Oct 22 '14 at 19:08
-
1I also recommend this paper on local and adaptive thresholding. http://people.scs.carleton.ca/~roth/iit-publications-iti/docs/gerh-50002.pdf Very simple to implement, and it works well. This is actually what I use when I want to "scan" in a document by taking a picture with my phone, then using this algorithm to create a black and white facsimile. – rayryeng Oct 22 '14 at 19:09
-
@Benoit_11 thanks for your response. I am agree with your answer. But how can we find those things? ( whether the picture has uniform contrast distribution or not?) – Chamath Sajeewa Oct 23 '14 at 02:12
-
@Chamath Just by looking at it I would say. As Ray pointed out (have a look at the link he provided) when the image is not too complicated and you can discern easily the shapes, i.e high contrast images, use global thresholding – Benoit_11 Oct 23 '14 at 12:56