Daniel Reetz, the founder of the DIY Book Scanner community, has recently started making videos of prototyping and shop tips. If you are tinkering with a book scanner (or any other project) in your home shop, these tips will come in handy. https://www.youtube.com/channel/UCn0gq8 ... g_8K1nfInQ

Making the Select Content Box fixed... or disabled?

Scan Tailor specific announcements, releases, workflows, tips, etc. NO FEATURE REQUESTS IN THIS FORUM, please.
User avatar
jimboh
Posts: 82
Joined: 06 Jan 2011, 00:55

Re: Making the Select Content Box fixed... or disabled?

Post by jimboh » 07 Jan 2011, 15:08

If a fixed content box is ever implemented, it would be nice if its size were fixed, and its location/placement could be moved up, down, or sideways with keyboard arrow keys. Maybe Ctrl-arrow combinations could be used to expand (or shrink, with Ctrl-Shiftt-arrow?) the box on the side, and in the direction of, the arrow.

Maybe the latter could be implemented apart from fixed-size boxes. Since the code already exists to move all four boundaries in all four directions with the mouse, would it be a huge problem to access the same code with the keyboard? Not really new features, but rather keyboard shortcuts to access existing features.

I'm thinking a lot about mouse-related tendinitis these days. FWIW.

User avatar
reggilbert
Posts: 49
Joined: 28 Sep 2010, 19:57
Number of books owned: 3000
Location: Buffalo, New York

Re: Making the Select Content Box fixed... or disabled?

Post by reggilbert » 07 Jan 2011, 16:46

jimboh wrote:I'm thinking a lot about mouse-related tendinitis these days. FWIW.
This concerns me on an ongoing basis. Like our eyes, without good use of our hands, we can be devastated professionally. Tendinitis itself is bad enough, but it can be just the first stage of irreversible injury. My first professional job, as a supremely amateur network administrator in the 1980s, was replacing a woman whose keyboard work crippled first her right wrist and then her left. This was in the days when awareness of carpal tunnel syndrome and related white collar work injury was in its infancy. The woman could not recover despite a year of management support and ended up having no choice but to retire.

Two solutions:

1) Proper mouse practice. Mainly this involves lots of picking up the mouse when getting into the margins of wrist movement. Our natural tendency is to strain for that last quarter-inch of movement if the pointer is close to where we want it to be, rather than pick up the mouse to get us back in the center of our wrist's range of movement. That is an ongoing temptation it is generally wise to resist. It is that last little bit of strain, minor individually, potentially crippling cumulatively, that needs to be avoided.

2) If you are a person with a dominant hand, change mouse hands. I know it sounds radical, but it took me less than a day to make the transition, with zero loss of ease and accuracy, and I am not one of those partially ambidextrous people. The switch has a huge advantage because it offloads a significant fraction of precision hand work from the hard-working dominant hand to the often much, much less used non-dominant hand. Since even properly executed mouse work can exacerbate strain caused by some other kind of work, switching hands can prevent incipient injury unrelated to computer work.

My more general advice to everyone I know: pay attention to the early signs of hand fatigue and actively mitigate them, even if it is only to get up from the keyboard every half hour to walk around the desk and stretch all the parts of your body, including your hands.

emmerick

Re: Making the Select Content Box fixed... or disabled?

Post by emmerick » 10 Jan 2011, 10:16

mellow-yellow wrote:Thanks Tulon and Spamsickle for your work! Building on Spamsickle's post above (http://diybookscanner.org/forum/viewtop ... =466#p4244), here are step-by-step instructions to effectively "override" the Select Content GUI option, thus manually setting each page's content area identically:

Overriding "Select Content":
  • 1. Open ST, set everything you need (probably apply to All Pages in most cases) through to #3.
    2. Click #4 Select Content, then Auto, then the Right ("Go" / "Process") arrow.
    3. Again in #4, manually select the contents of an appropriate page (one that represents others content areas)
    4. Click File, Save, close the project
    5. load file in UltraEdit or Notepad++ and press CTRL+R (in UltraEdit, then click Regular Expressions: UltraEdit) or CTRL+H (in Notepad++, then click Regular Expression)
    6. Find: Ultraedit: <content-rect width="*" x="*" y="*" height="*"/>
    Notepad++: <content-rect width="[0-9].+
    7. Replace: <content-rect width="2266.992912969609" x="114.8497733994654" y="559.9999999999999" height="2800.20634481498"/> --- Obviously, use your numbers here! Hint: search for e.g. IMG_2172.JPG, then find it's id="333" and add 2 to it, then do a search for "335" and you'll find this Replace line listed in the select-content section.
    8. Save the UltraEdit / Notepad++ file
    9. Open ST, click File, Open, select your project
After practicing, all 9 steps only takes 2 minutes (max) for L and R combined.


If you need to select multiple lines for some reason, you can try something like this:
  • 1. Find: Ultraedit: [<]param*^n*^n*^n*^n*^n --- this selects a number of lines between the <param> tags
    2. Replace: (with one you like from a fully formed line, such as shown below)
Below is a sample Proj.scantailor file, indicating the start of the Select Content part of the file:

Code: Select all

 <select-content>
      <page id="4">
        <params mode="manual">
          <content-rect width="2266.992912969609" x="114.8497733994654" y="559.9999999999999" height="2800.20634481498"/>
          <content-size-mm width="143.9540499735702" height="177.8131028957513"/>
          <dependencies>
            <rotated-page-outline>
              <point x="165.7588007253573" y="0"/>
              <point x="2411.827783763773" y="93.15644600765081"/>
              <point x="2246.068983038416" y="4089.720472766398"/>
              <point x="0" y="3996.564026758747"/>
              <point x="165.7588007253573" y="0"/>
            </rotated-page-outline>
          </dependencies>
        </params>
      </page>
      <page id="7">
        <params mode="manual">
          <content-rect width="2237.273311897106" x="10.7266881028936" y="401.1832797427654" height="2831.494105037512"/>
          <content-size-mm width="142.0668553054662" height="179.799875669882"/>
          <dependencies>
            <rotated-page-outline>
              <point x="0" y="0"/>
              <point x="2248" y="0"/>
              <point x="2248" y="4000"/>
              <point x="0" y="4000"/>
              <point x="0" y="0"/>
            </rotated-page-outline>
          </dependencies>
        </params>
      </page>

I still can not understand, could someone make a video tutorial or a classroom.

Thanks

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

Re: Making the Select Content Box fixed... or disabled?

Post by spamsickle » 10 Jan 2011, 11:04

What is a classroom?

emmerick

Re: Making the Select Content Box fixed... or disabled?

Post by emmerick » 10 Jan 2011, 14:46

i mean step by step sorry my english :)))

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

Re: Making the Select Content Box fixed... or disabled?

Post by spamsickle » 10 Jan 2011, 15:31

I think Mellow Yellow's list is pretty much a step-by-step. I could try to explain some of the steps more clearly if there is something specific you don't understand.

Ultraedit and Notepad++ are text editors which can do "regular expression" replacement of text. That means they're more flexible than the usual "search and replace" text editors, which can only replace "this" with "that" when it finds the exact characters t-h-i-s. A regular expression editor can match (for example) any word that starts with "t", or any string of numbers, etc.

When you do automatic content selection with Scan Tailor and save a project file, each image will have a content selection box which is specified by four coordinates. Making the content selection the same for each of those images requires replacing the coordinates which change from one image to the next with the same values in every image. This requires a "regular expression" editor, since the "content selection" numbers you want to replace are not the same for page 1 and page 2.

If you do have one of these editors (or some other editor that can search on regular expressions), then let me know what's not clear about Mellow Yellow's checklist and I'll try to explain it another way. If you don't have a text editor that offers regular expressions, you probably can't do it this way.

emmerick

Re: Making the Select Content Box fixed... or disabled?

Post by emmerick » 10 Jan 2011, 16:05

thanks buddy now understand, is because as I lay the picture is sometimes difficult without viewing.
Thanks

kitashi

Re: Making the Select Content Box fixed... or disabled?

Post by kitashi » 16 Jan 2011, 11:53

I wrote some codes that add "Apply to" dialog box to Select Content stage. I've just uploaded the codes to ST's git repository.

I've also made a PPA (Private Package Archive) for Ubuntu users:
https://launchpad.net/~arctica0316/+archive/ppa
Attachments
ContentApplyToDialog.png
ContentApplyToDialog.png (295.26 KiB) Viewed 7016 times

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

Re: Making the Select Content Box fixed... or disabled?

Post by Tulon » 16 Jan 2011, 13:31

kitashi wrote:I wrote some codes that add "Apply to" dialog box to Select Content stage.
I think you forgot to commit AboutDialog.h and .cpp.

Anyway, let's see how it goes. People over here know I am not a big fan of this feature, but if it goes smoothly, then let it be. We still have quite some time before 1.0.
I do see a point people might be complaining about: if you apply a content box to pages that didn't pass through the "Deskew" stage, your manual content box will not be preserved. That's not a bug - it's just how the dependency mechanism works.
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.

kitashi

Re: Making the Select Content Box fixed... or disabled?

Post by kitashi » 20 Jan 2011, 11:19

Tulon wrote:Anyway, let's see how it goes. People over here know I am not a big fan of this feature, but if it goes smoothly, then let it be. We still have quite some time before 1.0.
I do see a point people might be complaining about: if you apply a content box to pages that didn't pass through the "Deskew" stage, your manual content box will not be preserved. That's not a bug - it's just how the dependency mechanism works.
I'm sorry to reply late, and thank you for giving a chance to implement the feature that you don't like so much.
I understand what you talked about the dependency. I hope people won't complain.

By the way, if a page has been rotated, currently the manual content box looks to be in a wrong position, although their coordinates are same. It is because the position of the origin and the center of rotation of a page are different. (I think Mellow-Yellow's method above has same problem.) I'm now trying to fix this.
Attachments
rot.png
rot.png (43.88 KiB) Viewed 6926 times

Post Reply