Progress on dewarping functionality

Scan Tailor specific announcements, releases, workflows, tips, etc. NO FEATURE REQUESTS IN THIS FORUM, please.

Moderator: peterZ

Klaus
Posts: 3
Joined: 04 Mar 2014, 00:52

Re: Progress on dewarping functionality

Post by Klaus »

Tulon wrote: Do you mean the manual dewarping or have you tested line tracing in debugging mode?
It's not complete yet. Close, but still not quite there. As for the success rate, I don't have any data on that, as I am only testing it on the two pages from the progress update videos. I am trying to make it as robust as possible though.
I mean the manual dewarping. I wondered if this was actually possible to apply the same curvature setting to a group of pages.

I tried the line tracing mode for fun. It works quite well, except little jumps sometimes like in your video.
Tulon
Posts: 687
Joined: 03 Oct 2009, 06:13
Number of books owned: 0
Location: London, UK
Contact:

Re: Progress on dewarping functionality

Post by Tulon »

Klaus wrote:I wondered if this was actually possible to apply the same curvature setting to a group of pages.
I hope I won't have to implement anything like that. If automated dewarping will be able handle like 95% of cases, we wouldn't need that. I doubt such curve propagation would be accurate enough anyway.
Scan Tailor experimental doesn't output 96 DPI images. It's just what your software shows when DPI information is missing. Usually what you get is input DPI times the resolution enhancement factor.
Klaus
Posts: 3
Joined: 04 Mar 2014, 00:52

Re: Progress on dewarping functionality

Post by Klaus »

Tulon wrote: I hope I won't have to implement anything like that. If automated dewarping will be able handle like 95% of cases, we wouldn't need that. I doubt such curve propagation would be accurate enough anyway.
Ok, thank your for the answers and good work :)
hbitteur
Posts: 2
Joined: 04 Mar 2014, 00:53

Re: Progress on dewarping functionality

Post by hbitteur »

Hi all,
I'm working on Audiveris, an open-source scanner for printed music scores (Audiveris site)
For the time being, the program is able to detect a global skew and rotate the input image accordingly.
But I'd like to go further, and somehow "dewarp" the input image.

Let me precise the context:
From a first image analysis, I'm able to detect nearly all staff lines and barlines.
In theory, staff lines should be horizontal straight lines and barlines should be vertical straight lines. But this is not always the case in reality.
So I would like to "straighten" the staff lines to significantly ease the other recognition tasks down the road.

I'm not very familiar with warping. I've got the feeling that I should be able to use the crossing points between staff lines and barlines as kinds of "control points" for the dewarping process.
I'm already using JAI for image processing in Audiveris, and I've just investigated the Warp class and its subclasses, especially the WarpGrid class.
The WarpGrid class is almost what I'm looking for, since it performs a bilinear transformation within each cell.
However WarpGrid expects a regular grid of cells (same width, same height) something that does not easily fit my structure of staff lines x barlines.
What would be fine is a non-regular grid of cells, actually a collection of cells which are adjacent to one another and globally cover the whole page, but which are not necessary all of the same width and height.
Or perhaps another approach?

Any help or advice on how to address this dewarping problem of music scores would be much appreciated.
Thanks in advance
/Hervé
univurshul
Posts: 496
Joined: 04 Mar 2014, 00:53

Re: Progress on dewarping functionality

Post by univurshul »

hbitteur wrote:Hi all,
I'm working on Audiveris, an open-source scanner for printed music scores...
I'm not very familiar with warping...
/Hervé
Hervé,

What type of hardware are you using to scan/capture your hard print music scores?
Tulon
Posts: 687
Joined: 03 Oct 2009, 06:13
Number of books owned: 0
Location: London, UK
Contact:

Re: Progress on dewarping functionality

Post by Tulon »

Hervé,

If you can reliably detect staff lines and estimate vertical boundaries of the content area, then you could make use of Scan Tailor's dewarping code.
Watch my Dewarping progress update videos, then look for CylindricalSurfaceDewarper and RasterDewarper classes in the source code. Of course you would have to port them to Java / JAI, along with other classes they depend on.
Scan Tailor experimental doesn't output 96 DPI images. It's just what your software shows when DPI information is missing. Usually what you get is input DPI times the resolution enhancement factor.
hbitteur
Posts: 2
Joined: 04 Mar 2014, 00:53

Re: Progress on dewarping functionality

Post by hbitteur »

Thanks for your fast reply.

@ univurshul: There is no hard coupling between Audiveris software and any hardware. It just requires an image file as input, wherever it comes from (scanner, PDF output, photo, ...)

@ Tulon: Yes, detection of staff lines and vertical boundaries is reliable. This is the reason why I would like to take benefit of this very structuring data.
So, I will investigate your material.

Regarding source code, I noticed a dewarp1.0-src.zip posted by "rob" on this forum on 25 Dec 2009, 01:24
Can you tell me what the status of this code is? (because it is a Java program, it might be easier to start from)

Anyway, whatever the code language, is there a clear definition of a "dewarping interface" that I could feed with my control points?

Bye
/Hervé
Tulon
Posts: 687
Joined: 03 Oct 2009, 06:13
Number of books owned: 0
Location: London, UK
Contact:

Re: Progress on dewarping functionality

Post by Tulon »

hbitteur wrote:Can you tell me what the status of this code is? (because it is a Java program, it might be easier to start from)
You may use that if you prefer. It's biggest difference from my model is that it needs as many curved horizontal lines as you can get, while mine only needs two. This means if any of those lines are detected incorrectly, results would be unacceptable. In my model, chances are that lines that are traced incorrectly won't be chosen for the model.

BTW, yet another dewarping implementation can be found in the Leptonica library.
hbitteur wrote:Anyway, whatever the code language, is there a clear definition of a "dewarping interface" that I could feed with my control points?
You feed them to CylindricalSurfaceDewarper and than feed CylindricalSurfaceDewarper to RasterDewarper. Specifically, you feed two polylines representing two curved horizontal lines in your document. They don't have to be the first and the last lines, but it's a good idea to pick ones that are far away from each other. By providing two polylines, you also implicitly provide the two vertical boundaries. They are assumed to connect the endpoints of your polylines.
Scan Tailor experimental doesn't output 96 DPI images. It's just what your software shows when DPI information is missing. Usually what you get is input DPI times the resolution enhancement factor.
User avatar
rob
Posts: 773
Joined: 03 Jun 2009, 13:50
E-book readers owned: iRex iLiad, Kindle 2
Number of books owned: 4000
Country: United States
Location: Maryland, United States
Contact:

Re: Progress on dewarping functionality

Post by rob »

hbitteur wrote:Regarding source code, I noticed a dewarp1.0-src.zip posted by "rob" on this forum on 25 Dec 2009, 01:24
Can you tell me what the status of this code is? (because it is a Java program, it might be easier to start from)
I wouldn't use that code. It's not very good, and I know it doesn't deal with sheet music well.

--Rob
The Singularity is Near. ~ http://halfbakedmaker.org ~ Follow me as I build the world's first all-mechanical steam-powered computer.
Post Reply