Closed josef821 closed 7 months ago
My project was developed for a competition hosted by a technology company, focusing on the processing of scanned documents. These input images consisted exclusively of text lines, featuring only slight curvatures, like the one featured at the "Greek Text Example" section.
Do you have a plan to fix this problem? Or do you not intend to develop this program? I am writing an OCR and your program is very important to me. Only if you can draw a spline like the last photo and make the curve based on the spline, it would be great.
Hold up, you' re talking about a commercial OCR app/program ?
No. For my university project for my bachelor's degree, I chose the subject of OCR and I am examining the challenges that arise in creating this program and I am doing it practically to present to my professor. I tested different algorithms, but none of them were as fast and good as your algorithm. But this problem that I said exists in it and it would be great if you could solve this too so that I can put the name and link of your project in my project. The code you wrote can be useful for many people and is a good source for solving the problem of curvature in images. It is also a very good resume for you.
What you're describing is advanced image processing/dewarping, a field I'm not able to study right now because I'm in the middle of my PhD in a different subject. I'm sorry but I can't be of assistance at the time being. I wish you all the best for your project.
I'll spend the next few days polishing the code before finally uploading it. If you are interested, you can help me optimizing it.
it's very good. thanks but i'm not professional like you in computer vision and ai. But I am proud to be able to help. how can i help? share code to check.
The code and the "sports.png" image have been uploaded. It's not optimized yet and there are some parameters that are manually changed. That's the next step in order to fully automate it.
did you do this with "Alignment of Curved Text Strings for Enhanced "OCR Readability" article? or you create your own algorithm? explain to solve it together
It is an algorithm of my own. I start with the red line and for every point I calculate perpendicular points to the estimated curve. Something like this :
Then using Bresenham's line algorithm, connecting the two perpendicular points, I take all the in-between pixels and use them to create the new image. Finally, I use my old standard algorithm to straighten any deformations.
Overall, it's like scanning up and down across the estimated curve.
greate. i working on source code and check them line by line. seems i need much more time than you 😄
i try to fix this this curve image:
it found red line very good:
this is output image:
The algorithm you wrote needs some changes due to the large curvature. In fact, the middle of the curve is correctly smoothed( "S" character was uncurved correctly), but the left and right sides are not smoothed well. In an article titled "Alignment of Curved Text Strings for Enhanced "OCR Readability" worked like this. Can you make changes like this?