From: Charlie P. <x.p...@fr...> - 2016-03-08 21:08:01
|
Dear Team, First of all thanks for sharing this java library (with the great tutorials and documentation) with which I'm discovering the world of computer vision! Indeed I'd like to see if there are any noticeable performance (and accuracy) improvements by applying text detection before OCR (the corpus I am using is made of scanned images). To practice I am using http://i.stack.imgur.com/EingC.jpg and I like to apply the Stroke Width Transform algorithm on it but first the image I get now after applying SWT is all white (can't find the right parameter values, although it had worked just beforehand), and then I am lost on how to get the text regions. Here is the code I used (inspired from https://sourceforge.net/p/openimaj/discussion/general/thread/a56f1a03/) : Main(): / URL u = new URL("http://i.stack.imgur.com/EingC.jpg");// // FImage grayImage = ImageUtilities.readF( u ).normalise().process( new ResizeProcessor( 620 ) );// // DisplayUtilities.display(grayImage);// // applySWTOnImage(grayImage);/ applySWTOnImage():/ private void applySWTOnImage (FImage input){ float threshCannyLow = (float)0.1; StrokeWidthTransform swt = new StrokeWidthTransform(true, threshCannyLow, Math.min(threshCannyLow * 3, 1), (float)0.9); swt.processImage(input); DisplayUtilities.display(input); } / Regarding the parameters, somewhere in OpenCV documentation was written that the higher threshold in Canny was recommended to be 3 times the lower (can't find it anymore) that's why I set them as such in the constructor. As it worked and does not anymore, I could see the result of SWT algorithm a limited number of time, but I am stuck on what to do then to get the text boundaries as shown in the SWT paper (http://yoni.wexlers.org/papers/2010TextDetection.pdf) or everywhere when people show their results with SWT. So my questions are : why has the result of applying SWT become all white, or as it may be hard to answer, how should the SWT parameters be chosen to get something, and could you give me some hints on the steps to follow after the SWT ? Thanks a lot for helping and keep up this great work! Regards, CP |