Getting dimensions of parts from photos

compact8

Registered
Registered
Joined
Oct 13, 2012
Messages
350
Doing so is probably nothing new but for me, I am just starting to use the method and found it to be quite accurate and efficient - getting all the dimensions in one go instead of locating the features of the parts one by one. In a couple of occasions, the errors made in measuring with calipers were quickly identified with the aid of photos.

This is my recent work involving the use of photos. I have a gear box of an RC car that need be remounted to lower the center of gravity. To achieve that I need to make a new mount allowing the gear box to take up a tilted orientation. On top of that the gear box need be machined in order to mate with the new mount and a fixture need be made for the purpose. In doing so I need to locate some features on the gear box such as screw holes, the stands, the motors and so on. The way I did it was to take a picture of the gear box, import it into Nanocad ( essentially a free and old version of Autocad ), scale the image to 1:1 and rotate it to the desired angle before drawing the mount around the image and obtaining all required dimensions for machining.

1644034793538.png

There are two main sources of errors in this method :

1) Perspective distortion - this is an issue if the features to be located are not on the same plane perpendicular to the line joining the object and the camera. Perspective distortion causes the dimensions of features further away from the lens to appear smaller in the image. I am yet to figure out a simple way to eliminate this completely so I just alleviate the problem by using longer lenses ( e.g. 300 mm ) and increasing the camera-to-subject distance. May be a more rigorous correction method is to divide the image into several parts according to the distance from the camera and scale each part differently ? This can be done in photoshop manually but I am wondering if there are softwares that can do the same with less effort ?

2) Lens distortion - this can be corrected in photoshop to some extent but I am yet to do it.
1644034979861.png

I will appreciate if those who have used this kind of methods can share some of your experience.
 
Last edited:
I have used this method of reverse engineering in the past.

A calibration scale (or two) as suggested by @Karl_T will help. You could also use a grid of known spacing which will help identify any lens distortion. Cur the grid to fit around your part so it can be in the same plane as your measurements. I haven't used one, but I understand tha confocal lenses will reduce or eliminate distortion.

To reduce perspective errors, you may want to take multiple photos from slightly different angles. If you can image a part on the mill, you also will have the advantage of controlled displacement. I use a digital microscope and @JimDawson 's program which adds crosshairs and bullseye reticles to the image, along with the mill DRO to function as an optical comparator. I am able to locate features to better than .0005" that way.

One useful tip is that designers usually work in nice round numbers, angles, etc. If you determine whether they're working in metric or inch units, it is usually accurate to guess where the feature is located.
 
.... you may want to take multiple photos from slightly different angles. If you can image a part on the mill, you also will have the advantage of controlled displacement. I use a digital microscope and @JimDawson 's program which adds crosshairs and bullseye reticles to the image, along with the mill DRO to function as an optical comparator. I am able to locate features to better than .0005" that way....

I know 3D terrain maps are made in that way. A drone is flown over the area and multiple photos are taken for each spot from slightly different angles. Just not aware that the same method can be used for measuring parts on a milling table. Can you elaborate more on the set up ? I am just wondering if this is something affordable for hobby machinists.
 
Last edited:
I wasn't suggesting a DIY LIDAR setup although that would be cool. Just that multiple angle shots would give you a better idea of any distortions. There is some machine vision software that could probably accomplish this and the a system similar to that used by self driving vehicles should be able to as well. A search for diy laser feature scanner yields some interesting possibilities. https://www.google.com/search?client=firefox-b-1-d&q=diy+laser+feature+scanner
 
There are so-called SFM programs (Structure From Motion) that can reconstruct 3D objects from photos taken at different angles. This is the basis of the inexpensive 3D "scanners" you find online. It uses a suite of heavy-duty programs to analyze the photos so the process can take some time to complete. That said, as far as I am aware you don't get absolute measurements, just relative ones.

Some hobbyists have used SFM to scan objects and print replicas of them, but I don't know how much editing they had to do in order to get a decent print.

For relatively simple tasks like correcting for lens distortion, perspective shift and so on, the GIMP image editing program has built-in functions to do that kind of stuff, and it's free.

Regarding taking measurements from an object you've got on hand, RJ's comment about designers often choosing easy-to-figure values is a good one. If I measure some dimension and (for instance) get 30.1mm, I often find that 30mm is the correct one to use. This is for something that clearly was designed using the Metric system -- it uses metric screws or installs into a Metric-centric tool. Or it came from Europe. The same approach often holds true for Imperial-based stuff....although you may find it necessary to multiply decimal parts by 16, 32 or 64 to see if there's a reasonable fraction in there somewhere.

Items that use a mix of both systems -- well, they clearly were designed by the Devil or one of his acolytes and should be shunned :).
 
I'd do this by including a ruler in the photo or some object(s) you know the dimensions of. Then take the best photo you can and save it as a tiff. Placing the object on a flat bed scanner instead of taking a photo might work well to avoid image distortion, much depends on what you're imaging. From there use Gimp or similar to count pixels between objects you know the size of to get pixels/inch. Adjusting contrast and using sharpening routines will help define fuzzy edges. Then you determine how many pixels there are between features you care about and do the math to convert that to inches.

OK, I just reread what RJ does with a camera mounted in his mill. Brilliant. I see myself doing that someday. OK, it won't get you .0005 but what about mounting a laser pointer (or a laser bore sighter) in the spindle, laying the part on the bed, and moving the bed until the red dot's where you want it, using the DRO to get distances between points?
 
Back
Top