Straightening scanned plans and working out their pixel scale

Looks like I do have a bit of time to do one or two more blogs…
When you scan a plan from a book, 99.9 times out of a 100 they are not perfectly straight.
Using a paint program it is a relatively simple process to fix this.
It is also a good idea to work out the pixel scale for the image.
This can then be used to get unlisted dimensions from plans by using a pixel tool in a 2D paint program.
First load up your image.
My paint tool (the rather ancient Picture Publisher 8) has a pointer tool that lets me mark out a rectangle on an image without drawing anything.



The status bar shows the start coordinates and the width and height of the box.


Most locomotive drawings show the rail top as a line. Using one end of this line as a start point I draw the rectangle to the other end of the rail top line.
In the example below (red rectangle) it shows I have a height of 25 and a width of 2965.
I then start up the most useful application in Windows – the calculator. 
Make sure it is switched to Scientific view.


Divide the height by the width:
25 / 2965 = 0.0084317032040472175379426644182125
Then click Inv and press Tan
Inv Tan  =  0.48308955972084815380076833108458
This is the number of degrees that the image must be rotated by.
I then select the rotate by arbitrary amount option in my paint program and enter 0.483 degrees (anti-clockwise)

Now we have a horizontal plan, I pick a known dimension from the drawing, In this case the 32′ wheelbase.
This is 1532 pixels wide.
This translates to 1523/32  =  47.59 pixels per foot
or the other way up (32 * 12) / 1523 = 0.2521 inches per pixel
and multiply by 2.54 to get to centimetres per pixel = 0.6404
So now, if you measure 10 pixels on the drawing you know it is 10 * 0.2521 = 25.2 inches or 64cm
I usually mark this information directly on the drawing that way it never gets lost – provided you remember to save the altered image file.

Post a comment or leave a trackback: Trackback URL.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: