Fix Keystoning via hardware adjustments

Built a scanner? Started to build a scanner? Record your progress here. Doesn't need to be a whole scanner - triggers and other parts are fine. Commercial scanners are fine too.

Moderator: peterZ

the.traveller
Posts: 82
Joined: 22 Sep 2010, 03:58
E-book readers owned: Samsung Tab S
Number of books owned: 800
Country: Netherlands
Location: Rotterdam, Netherlands

Re: Fix Keystoning via hardware adjustments

Post by the.traveller »

Postby rob » Yesterday, 21:49
You were using radians when you have to use degrees. Not sure how to set degrees in Excel, though.
dpc wrote:Use the Excel function RADIANS to convert a value in degrees to radians.
sine of BC (30 deg) should be 0.5.
cosine of BC should be 0.8660254
Gentlemen, this is again proof of me not understanding mathematics. In my simple mind I had envisioned a half circle which will be 180 degrees. Never heard of radian.

Looking to the following websites
http://en.wikipedia.org/wiki/Radian
http://en.wikipedia.org/wiki/Degree_%28angle%29
http://math.rice.edu/~pcmi/sphere/drg_txt.html
http://www.mathsisfun.com/geometry/radians.html
http://www.teacherschoice.com.au/maths_ ... angles.htm

A radian is the length from the middle of the circle towards the outer edge which, in mathematics, has the sign of r.
However this is also the unknown length of b.
It is then used to calculate the total lenght of the circle.
Lets give it a try
degree = radians *(180/phi)
30 = radians * (180/1.61803399)
30 / 111,2461179 = radians
0,269672332 = radians

Nah, I can't imagine that the length of b is so short when c is over 30

I don't think radian is something that I need to be concerned about. Because radian has something to do with the radius of a circle. And we are not trying to calculate the radius of a circle. We try to calculate a triangle which has unequal legs a and b in which c is known and the corners of each intersection point.

Lets have a look at the wiki for triangles

http://en.wikipedia.org/wiki/Triangle#C ... and_angles

Usefull information but I don't know how to transfer them into that one meaningfull calculation.

But firt I go to sleep
Attachments
My unequal triangle
My unequal triangle
120 graden wieg 2.tif (703.36 KiB) Viewed 8491 times
dpc
Posts: 379
Joined: 01 Apr 2011, 18:05
Number of books owned: 0
Location: Issaquah, WA

Re: Fix Keystoning via hardware adjustments

Post by dpc »

To convert degrees to radians you multiply the number of degrees times the value PI/180:

radians = degrees * (PI / 180)
degrees = radians * (180 / PI)
30 = radians * (180/1.61803399)
This is wrong, as you should be using the value of PI (3.1415927) instead of 1.61803399.

30 = radians * (180 / 3.14159)
radians = 30 * (3.14159 / 180)
radians = 0.523599
the.traveller
Posts: 82
Joined: 22 Sep 2010, 03:58
E-book readers owned: Samsung Tab S
Number of books owned: 800
Country: Netherlands
Location: Rotterdam, Netherlands

Re: Fix Keystoning via hardware adjustments

Post by the.traveller »

For me it is mind dazzling.

Can we go a few steps back and forget the radians.

A circle is 360°. If we place an unequal triangle in it. It will look like this Goniometric circle.
Goniometric circle
Goniometric circle
Goniometrische-cirkel-sin-cos.png (8.76 KiB) Viewed 8482 times
I want to calculate the dashed line on the right and the red part of the cosinus line.

We only know the length of the black line which is going from the green 0 to the point on the circle. This is our hypothenusa c from the rectangle below.
Now my rectangle has the following sides
Rectangle
Rectangle
120 graden wieg 2.gif (6.83 KiB) Viewed 8482 times
The corner in the Goniometric circle which is called cosinus alpha (α) is the corner which I call AC. In my simple thinking way it has 30°(degrees), not radians.
Now the other opposite corner in the circle which is called sinus alpha (α) is the remaining 60° (degrees) at point BC in my rectangle.
My corner AB is 90°(degrees) which has no marking in the Goniometric circle but is the red line part of the cosinus where it intersects the dashed line.

Now we established that c was 12

The degrees of the three corners are
AB = 90°
BC = 30°
AC = 60°

What will be the correct formula for calculating

line a

line b

If it is only possible to calculate it by transfering first to radians and then getting the correct length of a and b please explain in detail which steps to take to get the final result. Remember math is not my strongest point.

So first show me the formulas and then the living example which I did before, to show the numbers filled in in the formula. Later I then can solve it in Excel so others can benefit also from it.
Please do it for both lines, because I have the feeling that they are not the same formulas.
User avatar
jck57
Posts: 376
Joined: 23 Nov 2009, 15:21

Re: Fix Keystoning via hardware adjustments

Post by jck57 »

the.traveller wrote:For me it is mind dazzling.

Can we go a few steps back and forget the radians.

A circle is 360°. If we place an unequal triangle in it. It will look like this Goniometric circle.
Goniometrische-cirkel-sin-cos.png
I want to calculate the dashed line on the right and the red part of the cosinus line.

We only know the length of the black line which is going from the green 0 to the point on the circle. This is our hypothenusa c from the rectangle below.
Now my rectangle has the following sides
120 graden wieg 2.gif
The corner in the Goniometric circle which is called cosinus alpha (α) is the corner which I call AC. In my simple thinking way it has 30°(degrees), not radians.
Now the other opposite corner in the circle which is called sinus alpha (α) is the remaining 60° (degrees) at point BC in my rectangle.
My corner AB is 90°(degrees) which has no marking in the Goniometric circle but is the red line part of the cosinus where it intersects the dashed line.

Now we established that c was 12

The degrees of the three corners are
AB = 90°
BC = 30°
AC = 60°

What will be the correct formula for calculating

line a

line b

If it is only possible to calculate it by transfering first to radians and then getting the correct length of a and b please explain in detail which steps to take to get the final result. Remember math is not my strongest point.

So first show me the formulas and then the living example which I did before, to show the numbers filled in in the formula. Later I then can solve it in Excel so others can benefit also from it.
Please do it for both lines, because I have the feeling that they are not the same formulas.
This site has an easy triangle calculator. Just put in the variables you know:
http://www.csgnetwork.com/righttricalc.html
the.traveller
Posts: 82
Joined: 22 Sep 2010, 03:58
E-book readers owned: Samsung Tab S
Number of books owned: 800
Country: Netherlands
Location: Rotterdam, Netherlands

Re: Fix Keystoning via hardware adjustments

Post by the.traveller »

jck57 wrote:
the.traveller wrote:For me it is mind dazzling.
This site has an easy triangle calculator. Just put in the variables you know:
http://www.csgnetwork.com/righttricalc.html
Yes this does it, thank you very much for this tip.

Pity they don't show the intermediate steps at his site?
Seeing the intermediate steps I can follow what is happening.
In this way I can reproduce them and put them in an Excel sheet for everybody to use and understand what is happening?

Have a look on how far I came with the suggestions from the other members.
http://www.diybookscanner.org/forum/vie ... 939#p10645
User avatar
jck57
Posts: 376
Joined: 23 Nov 2009, 15:21

Re: Fix Keystoning via hardware adjustments

Post by jck57 »

the.traveller wrote:
jck57 wrote:
the.traveller wrote:For me it is mind dazzling.
This site has an easy triangle calculator. Just put in the variables you know:
http://www.csgnetwork.com/righttricalc.html
Yes this does it, thank you very much for this tip.

Pity they don't show the intermediate steps at his site?
Seeing the intermediate steps I can follow what is happening.
In this way I can reproduce them and put them in an Excel sheet for everybody to use and understand what is happening?

Have a look on how far I came with the suggestions from the other members.
http://www.diybookscanner.org/forum/vie ... 939#p10645
To do the calculations yourself you still need to use sine, cosine, and tangent multipliers. In the old days, trig textbooks had tables in the back of the book with these functions for every angle. Now you just use a calculator with trig functions. You're way over my head If you want to go all the way back and derive the trig functions mathematically.

http://en.wikipedia.org/wiki/Trigonometric_functions

BTW, your example of the 30 degree right triangle is easy because the hypotenuse is twice the length of the side opposite the 30 degree angle.
the.traveller
Posts: 82
Joined: 22 Sep 2010, 03:58
E-book readers owned: Samsung Tab S
Number of books owned: 800
Country: Netherlands
Location: Rotterdam, Netherlands

Re: Fix Keystoning via hardware adjustments

Post by the.traveller »

jck57 wrote: Image
BTW, your example of the 30 degree right triangle is easy because the hypotenuse is twice the length of the side opposite the 30 degree angle.
Say What????
Say What????
hannah montana - say what.jpg (7.72 KiB) Viewed 8464 times
Let me chew a moment on that.

BC = 30°
c = 12

of which a = c/2 ==> 6

Totally correct according to the calculator website.

Still I would like to go back to the sixties when we had to do our own math.
Is there anybody who is
a. a mathematician
b. an understanding math professor
who can write down step by step the transition from formula to end result?

Thank you Jack for being so patient.
dpc
Posts: 379
Joined: 01 Apr 2011, 18:05
Number of books owned: 0
Location: Issaquah, WA

Re: Fix Keystoning via hardware adjustments

Post by dpc »

Now we established that c was 12

The degrees of the three corners are
AB = 90°
BC = 30°
AC = 60°

What will be the correct formula for calculating

line a

line b
Length of 'a' = cos(AC) * c
Length of 'b' = sin(AC) * c

So with 'c' = 12...

a = 0.5 * 12 = 6
b = 0.86025 * 12 = 10.4


Whether your trig functions require parameters that are in RADIANS or in DEGREES depends on the particular function implementation. Using the Windows calculator (calc.exe) you can select whether you want to input degrees, radians, or grads. If you need to convert DEGREES to/from RADIANS you can use the following formulas:

radians = degrees * PI / 180
or
degrees = radians * 180 / PI

Most people understand trig functions enough to enter degrees into a spreadsheet cell or calculator. I wouldn't think you'll need to show people how to derive the trig functions themselves.
the.traveller
Posts: 82
Joined: 22 Sep 2010, 03:58
E-book readers owned: Samsung Tab S
Number of books owned: 800
Country: Netherlands
Location: Rotterdam, Netherlands

Re: Fix Keystoning via hardware adjustments

Post by the.traveller »

Thank you dpc for the formula.
Now with the help from the website Jack showed us I have a better understanding of what I have to do, using which formula.
Eppi

Re: Fix Keystoning via hardware adjustments

Post by Eppi »

Hi all,
I'm new to the forum and have been following this thread with interest. Now I'm just a noob at this (first build still underway), so not as familiar with all the nuances & nuisances of book scanner design as you folks. But I thought I'd add my two cents worth anyway...

I'm following the "New Standard Scanner" build which means that my cameras will each be mounted on a fixed column. However, I am considering incorporating a minor tweak which I hope will help reduce keystoning. The idea is to mount the cameras to each column via a simple sliding (and lockable) mechanism. The mechanism will allow the camera position to be altered at 45º to horizontal, along a line which is parallel to the cradle (see blue line in diagram below ( I'm hoping that a diagram actually appears below, if not then I has mucked it up)).
Blue axis.jpg
Blue axis.jpg (22.88 KiB) Viewed 8438 times
So if the camera is positioned along this blue line so that it is directly over the center of the page, then keystoning should be minimised (along one axis anyway). Distance along the surface of the cradle will then be 1:1 with distance along the sliding camera mount.

This plan appears to be similar to the route that the.traveller is taking (lame pun not intended) just using a different plane of movement. Can anyone see any major problems with my plan? I can see that there will be a bit of extra work initially but if I mark some points along the slide which correspond to known points on the cradle surface then I'm hoping that setup time at the start of each book will be reasonable.
Post Reply