When creating models (replacement parts or parts that interact with real world objects),

(Henner Zeller) #1

When creating models (replacement parts or parts that interact with real world objects), I find myself measuring a lot parameters in the ‘real world’.

While calipers are still the most valuable tool for that, I simplified a lot of it by simply taking a picture of the object with a ruler in the same focal plane; then wrote a little tool that allows to draw simple lines and use that ruler to declare a known reference length - then all lines can be measured accurately enough for many uses. Also: angles between lines. Very simple, but pretty useful.

This tool is in JavaScript, so you can use it right in the browser (there is a link in the README.md)

Pull requests welcome.

(Mark Durbin) #2

That looks very useful, I’ll give it a go next time I need to fit a design to some parts.

(Liam Jackson) #3

Interesting, How much error is introduced, e.g. by the picture not being dead-on? I guess you use a tripod or mount?

(Mathias Dietz) #4

I just tried it. I like the angle measurement between lines.
Very cool !

(Ricardo Rodrigues) #5

Beautifully done

(Christopher Gaul) #6


(Eric Moy) #7

Excellent. You might be able to reduce the forced perspective by taking the picture further away and zooming, saw this on YouTube. Awesome idea, like a pour mans laser Scanner

(Stephen Hall) #8

there must be a way to calculate angular tilt from outlining a known square. and also I would think from a circle, I know you can work out a circle from 2 points but would think there is some long equation to work out a circle from three or four points on a tilted circle. More maths that I am comfortable with :slight_smile: Also printing out crime scene rulers might help.

(Liam Jackson) #9

Using something like graph paper with a printer ruler in X and Y would probably help with dimensional accuracy if the algorithm took the lines on the paper into account.

(Jens Sorenson) #10

You can correct the perspective and lens distortion with Hugin, then use Gimp to measure dimensions after adjusting the pixels per inch (or mm).

(Henner Zeller) #11

As @Eric_Moy said, taking a picture from afar helps keeping things parallel. In general, trying to keep the ruler in the same plane of items to be measured is a good idea. Also, flatbed scanners might be a good idea to keep the distortion down and have a pretty much parallel view of (smallish) items.

It is pretty simple to mark a trapezoid and use the information information to measure things in different distances @Stephen_Hall ; however keep in mind that this still forces the user the estimate in which distances (z) a particular object is when measuring its (x/y) parameters. Since in practice, when taking a picture of the object for measurement purposes, you have a good control to keep the lines straight (often less possible in the crime scene example :slight_smile: )

Figuring out the parameters of a circle with 3 points on the circumference is a TODO.

Right now, the picture is just a reference for the human drawer, the tool doesn’t infer anything from it, @Liam_Jackson . I was considering that (graph paper, or paper with special markers), but given that that detection would easily be dominating the needed code (in particular in JavaScript), I was going with the simpler route for now :slight_smile:

(Joseph Chiu) #12

Nice! This will be a great addition to my work bag. I often use a flat-bed scanner and import into CAD, but that only works well for objects that can sit on the glass. When being commissioned to design objects for “the public”, this would be a great way to easily get detailed measurements from the clients.

(Rob Mackenzie) #13

Thank you so much for creating this and sharing it with us all… it will be an invaluable tool for reading measurements off of airplane plans that are not dimensioned where you need them to be

(Joseph Chiu) #14

I would love this as a browser plugin to use directly off any web page. Dunno if that is practical to implement?

(Henner Zeller) #15

It is JavaScript, @Joseph_Chiu , so you can use it directly in your web pages, without even a browser plug-in.
If you mean directly measure pictures in other pages, yes, this probably could be done with a plug-in (I haven’t programmed any browser plugins, but someone certainly would know).

A simpler approach would be to just use an image from a remote URL - that certainly would be possible.

(Rob Mackenzie) #16

Ha… I had to look up “augenmass” as I speak neither German nor Dutch but now I get it!

(Christopher Gaul) #17

Place the part and your ruler on your scanner bed and scan it. No lens distortion.

(Kurt Meister) #18

Cool :slight_smile: Could you add the option to split the line into its x and y values? missing/deleted image from Google+

(Henner Zeller) #19

Regarding splitting line into (x/y) compoents, @Kurt_Meister , I’ve now implemented something that is probably useful for you.

It is not as simple as adding these lines for everything. The following questions come to mind:

  • Should this be for every line ? This might look a bit messy after a few lines.

  • In your particular case, you have a generated plan that has x/y exactly aligned to the axis of the picture. In a photography case, the image might be a bit rotated, so we might need to request the user what the 0-degree horizon would be, otherwise the dx/dy lines won’t make much sense.

So the compromise: there is now a checkbox at the top that allows you to switch on seeing dx/dy values. While drawing a line, it shows the square bracket, on final lines it just puts the dx/dy in the label to avoid too much clutter. Please try it out.

(Kurt Meister) #20

@Henner_Zeller I’m fine with your compromise. Very good solution and pretty smart and simple. :slight_smile:
missing/deleted image from Google+