2018-08-16 05:37:14 -0600 | received badge | ● Notable Question (source) |
2017-03-01 03:28:57 -0600 | received badge | ● Popular Question (source) |
2013-04-09 08:30:35 -0600 | asked a question | thresholding image in java Hi! i'm pretty much new with opencv, started few days ago, and i would like to use opencv in image preprocessing for OCR. I have an image that represents a payment order (printed mainly in some kind of red) filled with typed text (black). My goal (for now) is to create an image that contains only typed text. Iterating through pixels doesn't seem as a solution, i guess it would be pretty much slow. so i guess some kind of thresholding would do the trick. but, the problem is i don't know how to do it. To be more precise, i don't know how to define threshold.. So far i've got this: Mat image = Highgui.imread("file.jpg",Highgui.CV_LOAD_IMAGE_UNCHANGED); At this point i should have HSV image. Now i should define a mask (or threshold)? Mat mask = ??? and then i should use something like this Core.inRange(imageHSV, scalarLower, scalarUpper, mask); Some help would be appreciated... Thanks! |