Jump to content
 

Making scale drawings from photos


Recommended Posts

As the prototypes for my scratch building projects are pretty obscure, I often have to make scale drawings based on photos and a couple of known or even guesstimated measurements.

 

But I have never been able to figure out the exact procedure for removing the perspective from the photos. 

In theory, it should be possible to make a scale drawing by constructing a  two-point perspective drawing ”in reverse”. 

 

So I tried a little experiment. I wanted to see if I could calculate the correct height (Z) and width (Y) of this wooden box using only the picture and the length (X). I have made it a bit simpler for myself by taking the picture straight on without tilting the camera, so Z is unshortened. So the challenge is to remove the foreshortening on X and Y:

 

 

1_photo.jpg

 

Using standard 2-point perspective drawing theory I established the horizon and two vanishing points: 

 

2_vanishing_lines.jpg

 

Then I constructed the View distance, station point and measuring points: 

 

4_measuring_points.jpg

 

Next step was making a measurement bar and finding the unshortened length of the X and Y sides: 

 

5_measuring_lines.jpg

 

Now it should be just a matter of scaling everything so that the width becomes correct based on the known X dimension of 153mm. This should in theory give the correct Y and Z dimensions.  And measuring the height on the drawing gives indeed the correct height within a reasonable margin. But the Y came out  too short, only around 80% of what it should be. I did the same experiment with a diffent box and  got the almost exactly  the same error. So I am doing something wrong. Does anybody have a suggestion for where I went wrong?

 I would also love to hear from others that have tried to make scale drawings the same way, and maybe with methods that actually work…

 

Any input is very welcome !

Edited by Hawk
Link to post
Share on other sites

With such a solid structure, I don't have a clue. But if in reality, your prototype has windows or visible brickwork, I have always taken the physical measurements of those and then scaled everything from that. I don;t know if the end result has been geometrically to scale each time, but they certainly look right compared to photos. I wish I could show an example but my phone camera won't download to my PC!

Link to post
Share on other sites

  • RMweb Gold

"The Gimp" has perspective correction routines that can do this on screen for you. Martin Wynne has tutorials on his Templot site showing how to do it step by step.

Keith

 

Here's the link: http://www.templot.com/martweb/info_files/gimp_example.htm

 

An example of using the GIMP image editing program.

 

The GIMP is a free image editing package which includes perspective correction tools. This makes it possible to take measurements and make drawings from photographs, even typical corner views such as this. It is necessary to know one dimension in each direction of course, usually the overall length and height.

 

gnri_va1.jpg

 

This is a photograph of a GNR(I) 8 ton covered van. After scanning it I opened it in the GIMP, and selected the Perspective tool. An adjustable grid appears which I have dragged at the corners until it aligns with the edges of the body framing. You can zoom in close to do this accurately if necessary. At the top it was difficult to see the top edge of the frame, so I have aligned the second grid line with the lower edge of the top frame member instead. Note that everything which you align over must be in the same plane on the original - in this case the outer face of the framing.

 

gnri_va2.jpg

 

I then selected the Backward (corrective) mode and clicked the Transform button. After trimming the top a little this is the result. The perspective distortion has been removed but the image now has the wrong aspect ratio of width to height. So the next task will be to correct that.

You might find The GIMP a strange program to use. It scatters itself across the screen in several separate windows which have an annoying habit of hiding themselves behind each other while you are working. I find that I am constantly having to click them back from the task bar.

If you are looking at the image window, first click the Dialogues > Tool Options menu item. On that dialog window click the Perspective tool icon:

 

gimp_dialogs.png

 

Now click on the image. The grid should appear, and also the Perspective dialog window containing the Transform button. (There is a lot of additional functionality available by right-clicking on the image.)

 

gnri_va3.jpg

 

These GNR(I) vans are 16ft long and the bodyside height is 7ft (unless you know different - it doesn't affect the principles involved), so knowing this it was an easy matter to set the height to 7/16th of the width using the GIMP's Scale function, and the result is as above. This can now be saved, and then opened in a CAD program to have the dimensions picked off or a drawing made over the top. Or you could print it out directly from the GIMP and measure it. There are also measuring tools in the GIMP.

In most CAD programs (and Templot) background images can be scaled and re-sized, so this process can be left until then if preferred.

Note that only the outer face of the framing and other features in the same plane (the doors and strapping) can be accurately measured. To measure the recessed planking detail accurately it is necessary to repeat the exercise for the plane of the planking, aligning the grid with the planking grooves and the inner face of the framing.

If you don't have a CAD program you can take measurements in Templot. Working in 4mm scale I created a picture shape 64mm x 28mm (16ft x 7ft scale) and loaded the bitmap image into it. Templot will re-size it to fit, so there is no need to do this in the GIMP. (control > background shapes menu item in Templot, and then click the ? help button.)

 

gnri_va4.jpg

 

Here's the result. Notice how accurately the GIMP has corrected the perspective from the original photograph - the 32mm grid line is running exactly down the centre of the doors. Notice also that the left-hand end of the image is much more sharply defined than the right-hand end. It was nearer the camera and in better focus on the original. So obviously we take as many dimensions as possible from that end.

We can see immediately, for example, that the 12mm grid line is running down the centre of the first upright framing member, so we now know that this is a scale 3ft-0in from the end (4mm/ft scale).

 

gnri_va5.jpg

 

Next I wanted to know the width of the door openings. It's easy to take measurements using the X,Y read-outs on the jotter (tools > jotter menu item or CTRL-J). After zooming in I first changed the mouse pointer to cross-hairs (pad > mouse options > cross hairs pointer menu item or CTRL-FULLSTOP). I positioned the mouse over the  inner edge of the left-hand door framing, held down the ALT key and clicked the left mouse button. This set the dX = read-out to 0.00. I then moved the mouse over to the right-hand frame, and read off the dimensions. You can see that dX (the distance moved horizontally) is showing 17.97mm, which we can take as 18mm within the limits of error for this process, meaning that the door opening is 18mm (4ft-6in scale) wide. This is confirmed by the X = 41.00mm read-out, showing that the door frame is 9mm (2ft-3in scale) from the 32mm centre grid line.

To make these mouse positions clear in these screenshots I have added target marks (as spacing ring copies). It's not necessary to do this to use the jotter readout functions. Right-click on the jotter and then on the ? help item on the pop-up menu for more information about using the read-outs.

Martin.

 

Download the GIMP from the GIMP web site, or obtain it from computer magazine cover disks (e.g. the June 2002 issue of "PC Format" magazine).

More about using the GIMP on track photographs .

More about Templot.

© 14-June-02.

  • Like 2
  • Informative/Useful 3
Link to post
Share on other sites

About ten years or so ago, I was looking at the same sort of thing, working towards a more automatic way of getting dimensions from photos. Fun solving the quadratic regressions. However, it worked OK for things like the sides of wagons, where I had, more or less, lines running away from the viewpoint that can be referenced to, but not so good in other planes. If you need high accuracy then you need to know about lens/printing errors, etc. Also, if you try it on an image of a building, say, where someone has already manipulated the image in photoshop/whatever to correct for perspective, or used a tilt/shift lens or similar, it may need other aspects corrected. In my experiments, if the images were carefully selected, the results were good, but I needed to know the type of images that gave bad results. In further testing, I realised that my basic idea could not be extended to every image, so I left it alone, before my brain cell seized up.

 

A few years ago, there was a short article in RM, iirc, where a guy described how to work from a photo to get dimensions for a signal - completely wrong principles, but the result in that instance looked good enough - the model looked like the photo of the signal, which is not the same as looking like the actual full size signal.

 

When it comes to models, perspective/size is often altered to make things look right, anyway.

 

Best wishes,

 

Ray

Edited by raymw
Link to post
Share on other sites

  • RMweb Gold

There was a detailed article on drawing-board methods in MRN for January 1965:

 

post-1103-0-01406800-1427112331.jpg

 

There is a copy on eBay (not mine): http://www.ebay.co.uk/itm/Model-Railway-News-Jan-1965-scale-drawings-for-an-engine-shed-/201237041475

 

That was before the days of personal computers. I remember doing several photos that way -- it worked ok.

 

But using GIMP is a lot easier. :)

 

Martin.

Edited by martin_wynne
Link to post
Share on other sites

This is a lot easier to do manually if you're able to obtain photos taken from a long way away from the subject, where the image will exhibit much less distortion than in a close-up or angled view. It does help a lot to know a couple of main dimensions, such as wheelbase / diameter, distance between buffers, etc...

Link to post
Share on other sites

Thanks for pointing med towards Gimp! It is certainly helpful for removing the distortion. 

 

But I still try to wrap my head around the main challenge:

 

Is it possible to remove the distortion *and* remove the foreshortening without knowing any of the objects dimensions? Given that the object in the photo indeed is a box with all sides at 90 deg. to each other and that opposite planes are parallell.

 

The result would of course have no scale, but the proportions should be correct. I would think that using 2 point perspective drawing techniques in reverse, this should be possible!

Link to post
Share on other sites

Some years before I had a computer I had to make scale drawings for bus radiators and found a way of arriving at a formula for measuring off rads that were in perspective and not full front-on. It worked but I darned if I can remember the various mathematical formula. The man thing was it worked and so from the drawing I drew etching artwork 7.5 times larger than the finished 4mm scale article. 

Link to post
Share on other sites

Hi Hawk,

 

I think you will need some more information, probably angle of box to plane of image, and relative position/angle of camera lens to box. I'm not spending the time on it, but if you took a few photos from different viewpoints and measured the edges, drew up a table and by inspection you may well be able to find the relationships you seek - or - you could spend some time with geometry and fancy maths, then test the results on the various images.

Link to post
Share on other sites

The focal length of the lens through which the photo is taken will also have a significant effect on the perceived proportions of the image. A wide-angle lens producing a much greater distortion than a telephoto one. This is one of the reasons you need more than one photo, & preferably more than one known dimension to work from. 

Given that it is generally safe to assume that solebars, running plates etc are going to be parallel to the track, one can extrapolate height if a vertical dimension is known.  Similarly, buffers tend to be spaced at a fairly standard distance apart as stock has to be compatible with anything it's likely to be coupled to...

While whatever method one uses is likely to introduce at least some minor errors, if no reliable period drawing exists & your effort looks right, then it probably is!

Link to post
Share on other sites

There was a very complex and involved equation in an article in Model Railway Constructor in the mid-seventies, I think written by G Iliffe Stokes. No doubt, if you could resolve the equation, it worked, but I never managed it.

There really should be a photoshop plugin for solving this...

 

I really got my hopes up with Gimp, so I was quite disappointed when I read in the "help" information on the perspective function that it does not really take perspective drawing rules into account, it just removes the distortion.

Link to post
Share on other sites

The focal length of the lens through which the photo is taken will also have a significant effect on the perceived proportions of the image. A wide-angle lens producing a much greater distortion than a telephoto one. This is one of the reasons you need more than one photo, & preferably more than one known dimension to work from.

I beg to differ. If there is less distortion in an image, the vanishing points will move further apart, and this will increase the distance from the horizon line to the Station Point. Just like you are further from the object when you use an telephoto lens compared to when using a wide angle lens.

Link to post
Share on other sites

Hawk, I expect I'll have to dig out what I did back then, and see whether it is any help, although it was a different problem I was attempting to solve.

 

Going back to your original illustration. The only thing we know is one dimension, and we know all edges are at 90degrees. If the camera was looking straight down on the box, we could measure 'y'. If you had the camera at floor level, then X and Y would look like a straight line (and if in that case the camera was looking across the diagonals (or at a known angle) then we could measure/calculate  Y, but we would have to apply a quadratic regression to the dimensions if we knew the angle to the film plane (but if we knew that we could calculate it easily as I first mentioned) So I reckon you need another dimension.  I've not bothered too much with your drawing/explanation, since you say it does not work. There is distortion somehow in your image, since if the horizon is not in the centre of the image, then your vertical edges would be leaning. Your Y value is probably within the tolerances of your method (drawing/camera position/angle errors, etc.) Try it with other boxes/other directions.

 

It is one thing, working with an image when you have a few dimensions, or you make the image/images specifically for measuring things, quite another problem working on a single image of unknown origin.

 

Best wishes,

 

Ray

 

Perhaps, if trying to represent a one dimension object(a dot) into a 2d plane you need 2 dots (each end of a line), To represent a 3d object into a 2d plane you need 3 'dots' (corners of a triangle) . To represent a 4d object, it takes some time...

 

Link to post
Share on other sites

It is one thing, working with an image when you have a few dimensions, or you make the image/images specifically for measuring things, quite another problem working on a single image of unknown origin.

I agree, of course.

A scale drawing made with methods like this will always be an approximation. I would use it only as a last resort, or in addition with other bits of information.

Link to post
Share on other sites

Hi Hawk, I found some notes on my previous efforts as a pdf, which was really concerning a different problem, but may give some ideas. Not shown in the pdf is the days of scratching around, trying to sort out what should be happening (nor the weeks spent afterwards trying to extend the paradigm to other images - I've dozens of images of metre rulers at different angles, and aborted C# software).  I've just loaded it up to one of my sites for you to peruse/use if you want.  http://yertiz.com/cnc/photocalcinstructions.pdf .

 

Best wishes,

 

Ray

 

fwiw, I have a works drawing for that particular wagon, and the biggest error in the drawing is about 50mm

Link to post
Share on other sites

  • 1 year later...

I thought this 'perspective' trick with GIMP might solve a problem I'm having (trying to get accurate measurements of small, curved, components (a ruler is no good, because they are curved)). My Dad suggested taking a photograph of them on graph paper next to a ruler (to give scale) and drawing round them in AutoCAD (which we have at work). I knew I'd never be able to get the camera looking exactly straight down, which is what led me to find this topic. I've attached a couple of sample images to this post.

 

When I tried out GIMP's perspective function, it seemed to have done the trick at first (the horrizontals of the graph paper were horrizontal and the verticals vertical) but I couldn't get AutoCAD to align the image properly, or so I thought. Eventually I noticed that the grid-squares of the graph paper were no longer square on the GIMP 'perspective corrected' image, thus dashing my hopes of getting accurate measurements. Any suggestions of where I can go from here to get accurate AutoCAD drawings of these things?

 

Just in case it isn't obvious, the things in the images are the headlight/grill peices from a Hornby class 91 and DVT, but I have other small things I'd like to measure up too (I used the IC225 shots here as they are the only model railway related things I'm interested in measuring at the moment).

post-7703-0-63368500-1475095271.jpg

post-7703-0-66403700-1475095280_thumb.jpg

Link to post
Share on other sites

The GIMP Perspective Tool is only accurate on one plane, so if you're trying to measure small objects, the depth of it may be enough to produce an inaccurate result. It might work better on transparent "graph paper", if such a thing exists, with the object behind it, so you only have the thickness of the transparency to worry about. That may work for the side view, but not for the top view where the ends are further away than the middle. The resulting image from GIMP doesn't have the correct aspect ratio, so you need to stretch it both horizontally and vertically to known dimensions.

 

It might be better to put it on a scanner, rather than try to get a camera dead square to it.

 

I've no experience of AutoCAD, as I use Inkscape, so don't know what differences there are. In Inkscape, I wouldn't bother with the graph paper or GIMP, I'd just scan it straight in. I'd set vertical Guides for the length, that shouldn't be difficult to measure, and horizontal ones for an easy to measure height, then resize the scanned image to fit. If it's not square, it can be rotated to align with the Guides. Then it should be straightforward to trace either manually or maybe automatically.

Link to post
Share on other sites

Back to your original question Hawk, I think the error results from the picture being taken from a vertical position which isn't exactly level with the middle of the box.  Your horizon line appears to be below the centres of the vertical black lines you have added on the vertical edges of the box.  If the horizon isn't in the middle then your assumption of 2 point perspective isn't quite right and it introduces the error.

Either you need to retake the picture with the camera at exactly the right height or you need to do extend your method to use a 3 point perspective to correct for the position of the camera.

I think that, like the others have suggested, I'd reach for a computer at this point!

Link to post
Share on other sites

  • 3 months later...

The GIMP Perspective Tool is only accurate on one plane, so if you're trying to measure small objects, the depth of it may be enough to produce an inaccurate result. It might work better on transparent "graph paper", if such a thing exists, with the object behind it, so you only have the thickness of the transparency to worry about. That may work for the side view, but not for the top view where the ends are further away than the middle. The resulting image from GIMP doesn't have the correct aspect ratio, so you need to stretch it both horizontally and vertically to known dimensions.

 

It might be better to put it on a scanner, rather than try to get a camera dead square to it.

 

I've no experience of AutoCAD, as I use Inkscape, so don't know what differences there are. In Inkscape, I wouldn't bother with the graph paper or GIMP, I'd just scan it straight in. I'd set vertical Guides for the length, that shouldn't be difficult to measure, and horizontal ones for an easy to measure height, then resize the scanned image to fit. If it's not square, it can be rotated to align with the Guides. Then it should be straightforward to trace either manually or maybe automatically.

I just remembered that I had forgotten to thank you for the suggestion of putting it on a scanner, so thanks for that. Scanning did seem to produce a much more usable image, but I still haven't got round to drawing round it in AutoCAD. I did have a go a while ago, but my zero prior experience with the SPLINE tool proved insufficient to accurately match the shape.
Link to post
Share on other sites

I would suggest, if you are interested, to go outside, and take some photos from different positions (camera at different angles, different lens, etc.), of a brick built building or wall. Then see if you can get a corrected 'square on' image after 'gimping' with the all the bricks the same size and correct proportions. Measure a few courses of the actual brickwork to see if you have done it right. When you've mastered that, then you may stand a better chance in correcting images that you have not taken. Many of the images of model buildings I have seen are not tall enough, due to the perspective correction used (not good enough to just get vertical lines parallel).

 

Best wishes,

 

Ray

Link to post
Share on other sites

  • 8 months later...

sorry for not being computer literate or even being any good at maths /geometry is there a very simple method of taking a scaling from a photograph to enable you to reproduce the photo to a scale model

I have done this quite a bit for scratch-built wagon models. I was fortunate in having access to a calculator with a 'Constant' function; I measured some dimensions from the photos, then compared them with given dimensions on a BR Weight Diagram (a very crude outline sketch). From this, I worked out the scale of the photo, and from this the constant (the ratio of the scale of the photo to the scale I was modelling in) and then took large numbers of dimensions off the photo, using them to make a scale drawing. It would have been very laborious without the calculator. 

Link to post
Share on other sites

I have used Sketchup 3D programme - which is easy to use to create a 3D version of the building based upon the photograph.  The 3D model is built full size in your computer and I use brick dimensions and known typical door and window sizes as a guide for dimensions.  On completing the 3D drawing it can then be compared with the original photograph.  It can then be tweeked as necessary by rotating the model to match the photograph.

 

The 3D drawing is then translated into 2D. I use Autocad, but the elevations could be drawn out with a set square and tee square.  In either case the dimensions of the building and the position of windows and doors are established from the 3D model.

 

And, of course since completing the construction of the model, a drawing of Whithorn Station has come to light.  In his recent book, ‘The Port Road’, Andrew F.Swan included a floor plan and the platform elevation of Whithorn Station.   The book tells us that the building was 74’0” long by 18’0” deep.  A check on my built model found my dimension of the front elevation is only 18” short when compared with the original, and is the correct front to back depth. I had not allowed for the doors being slightly wider on the original when I drew it out. 

whithorn station building.skp.pdf

post-1767-0-69471000-1506264827.jpg

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...