Scan Tailor

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

Moderator: peterZ

spamsickle
Posts: 596
Joined: 06 Jun 2009, 23:57

Re: Scan Tailor

Post by spamsickle »

What do you mean by "almost always chooses the wrong side for the page"? That, in your image, it would have picked the big trapezoid on the left rather than the rectangle on the right? That wasn't my experience with it. Granted, I've only tried it on half a book's worth of images at this point, but the only time I saw it picking the "facing" page is when the "correct" page was blank -- the problem I alluded to in my initial post. In my books, that's a handful of images, and Scan Tailor gives me the option of interactively specifying the page when I'm not happy with its automatic selection. In some cases, it did pick a bit of the facing page along with the correct page, but it was easy to find those by going through and asking for the "widest" page interactively, and fixing those manually. For me, it certainly didn't happen with most pages; I'd say it was less than 1 in 20.

I tried PostProcessor, but don't really use it because (for me) it always seemed to crash after a few pages ("negative border added" or "null pointer exception"). I don't have the luxury of going back and re-photographing some of the books I've scanned, so changing the images to conform to what PostProcessor wants wasn't an option. And, honestly, I couldn't see anything wrong with most of the images it was having a problem with anyway. It's obvious that a lot of work has gone into PostProcessor, but it just wasn't doing the job for me. I think it would be great if you could spare some time to make it more robust; sadly, in spite of my initial offer to help with it, I probably won't have any time to devote to it myself before 2010. I did steal your main logic for Yapp :>

I can live with keystoning, and even with images that are rotated a bit. I guess everyone's requirements are different, which is why it's good that we have options. For me, readability depends on clear (contrasty) text, and I also want good greyscale or color image quality. I don't have a lot of time to go in page-by-page and specify what is text and what is image, so the program has to be able to handle images automatically without freaking out. So far, it looks like Scan Tailor does a pretty good job of that (which may be why it doesn't attempt to correct keystoning), and the fact that it's interactive means I can tweak what doesn't look right pretty easily.
edembowski
Posts: 9
Joined: 04 Mar 2014, 00:52

Re: Scan Tailor

Post by edembowski »

Rob,

How did you deal with QT? Did you use fink, or did you compile it yourself? I've been having problems getting fink to install it. Also, did you use qt3 or qt4?
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: Scan Tailor

Post by rob »

spamsickle: I know, PostProcessor isn't doing so well these days. I'm working on it in bits and pieces... But actually, I misinterpreted what Scan Tailor was doing -- I take it back! It did select the trapezoid along with the page, but then it selected the content properly, so the trapezoid selection was moot.

edembowski: I used darwinports, qt4-mac. "sudo port install qt4-mac" and you're done! You also need boost, libjpeg, libz, libtiff, and libpng.
The Singularity is Near. ~ http://halfbakedmaker.org ~ Follow me as I build the world's first all-mechanical steam-powered computer.
edembowski
Posts: 9
Joined: 04 Mar 2014, 00:52

Re: Scan Tailor

Post by edembowski »

Thanks Rob, I'll try that out. Hopefully, I'll be able to get fink & darwinports to play nice together....
Tulon
Posts: 687
Joined: 03 Oct 2009, 06:13
Number of books owned: 0
Location: London, UK
Contact:

Re: Scan Tailor

Post by Tulon »

Hi everyone!

I am Scan Tailor's author.
Daniel Reetz kindly invited me to this forum, and believe me or not, until that moment I didn't know book scanning communities even exist in western countries. Indeed, I had like 3 English speaking users giving me feedback from time to me, and the rest were Russians. So, feel free to ask me some questions now :)

We should probably start translating Scan Tailor's documentation from Russian into English. I guess I am the only person capable of doing this? Anyway, as I like to say, "Scan Tailor without documentation is still easier to use than ScanKrosmator with documentation."
edembowski
Posts: 9
Joined: 04 Mar 2014, 00:52

Re: Scan Tailor

Post by edembowski »

Hi Tulon, welcome!

Earlier today I compiled scantailor on my Mac, and I've been using it to process a book that I've scanned. One thing that's a bit different with the way we scan books here is that we're using cameras to shoot the page, and that gives output that's a bit different from using a flatbed scanner. Take a look at some of the posts for some examples, Rob has a good thread here: http://www.diybookscanner.org/forum/vie ... hp?f=3&t=4

What I've found so far is that your program has a very well structured workflow to it, and deals very well with correcting and deskewing pages. One specific feature that I likes was the page rotation, and how it could be applied to every other page. I was also very impressed with the deskewing of text, as well as the very high quality of the output.

The only area that I'm seeing problems with is the detection of the text area. I find that often it does not select the full text area and needs manual adjustment. Once I correct that, it seems to output exceptional quality images ready for OCR.

Thanks for such a great app.

- Ed
Tulon
Posts: 687
Joined: 03 Oct 2009, 06:13
Number of books owned: 0
Location: London, UK
Contact:

Re: Scan Tailor

Post by Tulon »

I am actually surprised you've managed to build it on a Mac. Is Qt in darwinports the native one, or the X11 one? If it's the former, I would expect you to hit problems with my direct calls to XRender, which is probably not available on Mac. If it's the latter, well - that kind of configuration is completely untested, but it may work I suppose. BTW, I call XRender directly because Qt/X11 doesn't accelerate drawing of transformed pixmaps, which produces very poor performance.
edembowski wrote:What I've found so far is that your program has a very well structured workflow to it, and deals very well with correcting and deskewing pages.
Well, the ease of use is the main goal of ST. For deskewing I actually use the same algorithm from leptonica as Rob does. I don't use leptonica itself for various reasons though. The main reason would be its lack of thread-safety, which I need, as I do processing in a background thread. Basically I just reimplemented everything I needed from leptonica.
edembowski wrote:The only area that I'm seeing problems with is the detection of the text area. I find that often it does not select the full text area and needs manual adjustment.
In earlier versions, content area detection used to have the opposite problem. It would interpret various kinds of garbage as content. Now it became much smarter, and it can handle very hard cases, like binarized images with lots of noise. Unfortunately, it's now too eager to classify stuff as garbage, with page numbers often being the victims. If a page number is too far from the rest of content, it's almost for certain it will be classified as garbage. To deal with that, we need to improve the rudimentary text detector that I have, to be able to trust it more. Any computer vision experts here? Anyway, I would like to see a page or two where it fails. It can fail for several reasons, and it's always good to know why it fails for different people.
edembowski wrote:Thanks for such a great app.
Glad you liked it!
edembowski wrote:Once I correct that, it seems to output exceptional quality images ready for OCR.
Good output quality is due to 3 things:
1. There is exactly one geometric transformation from the source image to the output image. That means I don't do rotation first, than deskew, then resample - I do all these operations in one step. That's one of the reasons there is no option to output intermediate results from various stages. The this is those intermediate stages don't produce any images - they only produce information about the source image.
2. There is a quite powerful illumination normalization algorithm. It currently has a drawback though - it doesn't like margins of artificial origin, that is margins added by software rather than dark areas captured by a scanner or a camera.
3. Before binarization I apply Savitzky-Golay smoothing. As far as I am aware, no other open-source software is using this method. This algorithm is mostly used for smoothing things like stock graphs, rather than images. It produces quite nice results though.
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.
edembowski
Posts: 9
Joined: 04 Mar 2014, 00:52

Re: Scan Tailor

Post by edembowski »

Tulon wrote:I am actually surprised you've managed to build it on a Mac. Is Qt in darwinports the native one, or the X11 one? If it's the former, I would expect you to hit problems with my direct calls to XRender, which is probably not available on Mac. If it's the latter, well - that kind of configuration is completely untested, but it may work I suppose. BTW, I call XRender directly because Qt/X11 doesn't accelerate drawing of transformed pixmaps, which produces very poor performance.
I have to say, I didn't pay much attention to the build process, but I think it built the native one. Running scantailor or the QT demos don't require a running X11. As far as XRender support on Mac X11, I do have a RENDER extension loaded. Perhaps that's providing some compatibility?
...Anyway, I would like to see a page or two where it fails. It can fail for several reasons, and it's always good to know why it fails for different people.

One image I'm is a little dark, and it's one of the ones that it has a problems with. It's too big to attach, can I email it to you? I suspect that the darkness is the culprit. When I took this, I was playing with different exposure settings. It picks up the text from the line starting "in the case of" about a third of the way down.
edembowski wrote:... It produces quite nice results though.
So here's a problem I'm having with saving the output: This may be because I'm on a Mac, but the saved image is not usable. On screen there are no problems. Can I send you one of these as well?

- Ed
Tulon
Posts: 687
Joined: 03 Oct 2009, 06:13
Number of books owned: 0
Location: London, UK
Contact:

Re: Scan Tailor

Post by Tulon »

Tulon wrote:One image I'm is a little dark, and it's one of the ones that it has a problems with. It's too big to attach, can I email it to you?
In the Russian community we just upload stuff to rapidshare.com or a similar service, and then post a link to it in the forum. Posting a couple of pages should be fine from the legal point of view, so that seems to be the best solution, and others would be able to make comments on those pages as well.
edembowski wrote:So here's a problem I'm having with saving the output: This may be because I'm on a Mac, but the saved image is not usable. On screen there are no problems. Can I send you one of these as well?
PPC or Intel Mac? If it's PPC, I might have got endianness wrong when saving to TIFF. Libtiff is very poorly designed, so you are almost guaranteed to getendianness wrong if you don't test it on all platforms. Fortunately I have an old PPC iBook around, so it's not going to be hard to fix. You may still send me an output image to take a look though.
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.
edembowski
Posts: 9
Joined: 04 Mar 2014, 00:52

Re: Scan Tailor

Post by edembowski »

It's an Intel mac. I'll put together some samples and send you a link. One thing I'm doing as a test is rebuilding with QT from trolltech, and not through the ports. You may find this interesting:

Code: Select all

-- Looking for Q_WS_X11
-- Looking for Q_WS_X11 - not found.
-- Looking for Q_WS_WIN
-- Looking for Q_WS_WIN - not found.
-- Looking for Q_WS_QWS
-- Looking for Q_WS_QWS - not found.
-- Looking for Q_WS_MAC
-- Looking for Q_WS_MAC - found
-- Looking for QT_MAC_USE_COCOA
-- Looking for QT_MAC_USE_COCOA - not found.
- Ed
Locked