Frustrated with Margins - resulting in 8 questions

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

Moderator: peterZ

Post Reply
tkr
Posts: 35
Joined: 29 Jan 2012, 21:53
Number of books owned: 0

Frustrated with Margins - resulting in 8 questions

Post by tkr »

As the title suggests, I'm very frustrated with trying to use Scantailor's margin options (and just Scantailor in general)
I've looked at the instruction videos, tried to read other diybookscanner posts on ST etc, read the Scantailor wiki - all to no avail.

Scantailor has a lot of useful features and I'm sure I could be more productive with it if I knew what each function is supposed to achieve, and how to do it. So rather than just stewing in my juices, I decided to write down my questions in the hope that the answers I get here, will help me as well as others who might be struggling with the tool.

Background:
I use YASW by tibob) to get the correct orientation, cropping and de-warping steps, because it does this step very fast. I then import into Scantailor using ST mainly for its automatic content box feature as well as because the output gets rid of the page texture and leaves me with a nice white background.

Here are my questions (numbered - so that the responses I hope to get here, can refer back to them)
a) I have markers on my jig which allow me to calculate DPI accurately along each dimension (left, right, top, bottom) - should I calculate DPI before or after performing de-warping ?

b) The plane of the book and the plane of the camera are not (always) parallel - so I often end up with left side of the page having a higher DPI than the right side of the page (same goes for top/bottom). The difference in DPI is not a lot - a variation of perhaps 10 DPI - is this significant ? What value should I use in ST for the X and Y DPI ? (I'm interested in having the tiff output match the layout of the book page, even down to size of page).

c) Is it better to process all pages on one side first before moving to pages from the other side ? (i.e. generate tiff output for L pages before starting to process all R pages ? If so, what will ensure uniformity ? I like doing each side separately, because it is easier to navigate among the pages.

d) The input image contains the book and a little bit more (say 1" around each edge of the book) - should I carefully crop at the corners of the page(and hence spend time on this detailed activity) or just leave as is and let 'content' box handle it ?

e) Split pages : do I have to obsess over getting the split just right - seems like this step is covered by content box - what criterion to use to determine that it is good enough ? (I usually photograph a single book page at a time)

f) I have the physical book at hand, also have a good pic of the book cover which I could use as a reference. I am using page number as locating feature for useful content on the page. I want the position of page # in output tiff to be at the same location as in actual book,and also for margins in output tiff to match actual page - any straightforward process to do this ?

g) What is the intent behind having output DPI be 2x input DPI ?

h) Any information on what the following are supposed to do and can someone expound on the individual options and how to set them ? Select Content/PageBox, SelectContent/ContentBox, Margins/Margins, Margins/Alignment

Thanks
TKR
abmartin
Posts: 79
Joined: 15 Sep 2010, 15:33
Number of books owned: 2000
Country: USA
Location: Ohio

Re: Frustrated with Margins - resulting in 8 questions

Post by abmartin »

I too found Scantailor a little strange until I had processed a few dozen books with it. Once I figured things out, it's completely brilliant!

I'll answer those questions which I am able to do. I use a script file that does the geometry correction and cropping that's pretty similar to YASW and before that I used BookScanWizard to do the same things, so we have similar setups.

a. I calculate DPI after. Adjusting geometry will change the length of some of those measurements, so I wait until after. It's not hugely significant, but it's usually different by a couple of pixels each time.

b. Your dewarping step should take care of that. (hence why we should calculate afterwards)

c. Since we can't set a manual page size in scantailor, the only way to guarantee that left and right pages are the same size is to do them together.

d. I trust the content box. (Assuming the crop is on the corner of the platen, that stops most strangeness with autodetection)

e. Same as D. There are a few instances where the autodetection doesn't do things perfectly. (in my case, with music scores, it likes to split between the braces and the beginnings of staff lines) I just then manually set all pages to full-page, because my crop takes care of that anyway.

f.I'm not entirely sure what you are asking. Scantailor-enhanced does have the ability to set margins identically to the source. (I'm okay with doing it manually. It does require some manual adjustments for certain pages, such as the first page of a chapter without the upper heading. With some practice, I can manually do the margins on a book in a just a couple of minutes -- since we have the option of sorting by page height and width, it makes it easy to find the outliers, and also take care of things that autocontent box doesn't get perfectly)

g. Process a book both ways and compare. If you are happy keeping it the same, stick with it. I find that doubling does makes things smoother on the screen. (Basically a little anti-aliasing) It does take a bit more space, however.

h. The margin section allows you to set the size of the margins. (I use a quarter inch all around, myself, with some manual adjustments if there is an outlier page or two) If you are wanting to keep things identical to the book, you can manuall set the margins to match what you are seeing on the screen, then apply appropriate to all left pages, then do it for the right pages. On-screen, the inner box is the selection area, then the outer box is what the page size is going to be.

Margins - alignment -- If you have a page with a header that is always on the top, you can set the alignment to the top. If there is a centered image, click on the center for that page. Most books have something that is in a consistent place (usually the page numbers are either up top or at the bottom) The 9 possible options seem to cover all scenarios I have encountered. When a page doesn't work to one of those points, you would then change the margins for that page. But usually, having everything centered on the top will do it, then sort by height, and look at the short pages. Those will probably need manual work -- like images needing centered, or first pages of a chapter which might need some extra margin up top (or, in some cases, can be a aligned to the bottom)

In the margin stage, it defaults to every page being the same size. There are some books where I have to occaisionally set one page to not match the others. (such as a page with a foldout, or sometimes a full-page image)

I'll admit the margin thing can be tricky. But, you're really best off just playing around with the settings to see what happens. It will eventually not only make sense, but become very efficient.
tkr
Posts: 35
Joined: 29 Jan 2012, 21:53
Number of books owned: 0

Re: Frustrated with Margins - resulting in 8 questions

Post by tkr »

Abmartin,
Tks for responding.

re c) Since we can't set a manual page size in scantailor, the only way to guarantee that left and right pages are the same size is to do them together.
I guess I could use the same page (say front or back of the book) as a reference for both left and right sides, couldn't I ?

re: With some practice, I can manually do the margins on a book in a just a couple of minutes
Would you consider doing a youtube video showing your process and also talking about some of the various options available in Scantailor - enhanced ? It looks like there are many more options in the enhanced version, and not much documentation on how to use them.

TKR
kveikko
Posts: 1
Joined: 30 Oct 2013, 16:01
Number of books owned: 0
Country: Finland

Re: Frustrated with Margins - resulting in 8 questions

Post by kveikko »

tkr wrote:I guess I could use the same page (say front or back of the book) as a reference for both left and right sides, couldn't I ?
I also use the reference page method. Often scan an extra page against dark background to get visible page edges. So it is possible to make the final output about the same size as the original was.

To import the original settings for the second set you can
-> Move the images from out folder to "final" folder.
-> Delete all images in scantailor, except the reference image
-> Import the new images to scantailor
-> select all images so that the last selected image is the reference image (a couple of ctrl+clics)
-> now you got visible and selected the settings for the reference image
-> apply to all
dtic
Posts: 464
Joined: 06 Mar 2010, 18:03

Re: Frustrated with Margins - resulting in 8 questions

Post by dtic »

f) Use other tools to first rotate, deskew and crop to the whole book pages and nothing more. Then run Scan Tailor Enhanced command line with content selection disabled and margins set to 0.
dtic
Posts: 464
Joined: 06 Mar 2010, 18:03

Re: Frustrated with Margins - resulting in 8 questions

Post by dtic »

I should have added that you can also try using Scan Tailor Enhanced to first rotate, deskew and crop to the whole book pages. Use something like this on the command line

Code: Select all

"C:\Program Files\Scan Tailor\scantailor-cli.exe" --layout=1.5 --disable-content-detection --enable-page-detection --enable-fine-tuning --margins=0 --dpi=350 --output-dpi=600 --color-mode=black_and_white "C:\input\folder\" "C:\input\folder\out\"


I think page cropping works best with black background on the tray around the book. I'm not entirely satisfied with it even then, but maybe some tweaks to the lighting, background color and so on can fix that.

If you make a script that runs a modified version of the above command on one image at a time (not the whole folder) and also add syntax to output a project file ( -o="C:\input\folder\out\proj\INPUTFILENAME.jpg.scantailor" ) then you can use QuickPicZone to afterwards make some of the pages into mixed mode images.
Post Reply