Scalable ruler

Started by Jennifer, December 04, 2016, 07:02:17 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Jennifer

Can anyone tell me where I can find a scalable ruler object that I can use to position alongside images in photos to get a sense of the sizes of the components? A standard 12 inch rules with both inches and centimeters would be great, but I'd be happy with just inches.
Using Visio 2019, part of Office 365 on Windows 10

Croc

#1
Jennifer,
About a year ago I was solving a similar problem. It was necessary to measure the length of the garlands on the house.
Then I made a special tool to change the scale of drawing.
It works as follows:
1. It is necessary to put a picture and the gauge on the page.
2. Align the gauge with a fragment whose size is known.
3. Enter the size into text of the gauge.
4. Run the "Prepare" function.
The drawing scale will be changed. In the new scale you can perform the measuring by any conventional means.
The gauge and macros are placed in the "Prepare5.vss" stencil.
The "gauge.gif" file shows how this works.
Try it.
https://yadi.sk/d/6MR1RWX-32Frcb

Jennifer

Very clever idea, Croc.

I thought briefly about changing the scale of the page so I could use the built-in dimension objects, but I was afraid that my Visio skills would mean that I'd spend most of a day or more fiddling with the details to get it to work.

I ended up making a scalable ruler that I can use that is good enough for what I need this time. I'll keep the link to your tool for future reference.

On my first attempt, I created a standard 1-foor ruler with divider lines for 1/2", 1/4", 1/8", and 1/16" and numbers (1-12) every inch. I first created a one-inch section and then replicated it 12 times. I made the whole thing into a group, but when I changed the size, the numbers did not scale. So I copied the whole thing to the clipboard and then pasted it using paste special as a picture. Works great.

I also (re)learned about parallax. I wanted to get as much detail as possible, so I shot the photo up close. When I got it into Visio, it was immediately obvious that an inch was not always an inch. I had to reshoot it from as far away as possible using the camera's maximum zoom setting.

Thanks
Using Visio 2019, part of Office 365 on Windows 10

Jennifer

Quote from: Jennifer on December 05, 2016, 04:53:31 PM
I thought briefly about changing the scale of the page so I could use the built-in dimension objects, but I was afraid that my Visio skills would mean that I'd spend most of a day or more fiddling with the details to get it to work.

The scalable ruler didn't work out that well. It was too difficult to get it to line up, especially if the object wasn't rectangular.

So I went back and looked into scaling the image. That turned out to be easy and it works very well.

Here's the procedure:

  • Obtain a good image of the object that is not distorted. This means taking the photo from far enough away that the parallax distortion is minimal.
  • Obtain at least one accurate measurement. It works best of this measurement is one of the longer dimensions in the photo.
  • Paste the photo onto a Visio page.
  • Change its protection setting to preserve the aspect ratio.
  • Place one of the architectural dimension objects on the page. This is one that automatically displays the length.
  • Set its length to the length of the known dimension.
  • Scale the image so the dimension object exactly fits the known dimension of the image.
Now other dimension objects will reveal other dimensions on the image.

I knew a few of the dimensions of the object I wanted to measure. At one point, it was 6.5" wide. I placed one of the architectural dimension objects and set the length to 6.5". Then I scaled my image until the part that I knew to be 6.5" wide matched the dimension object that read 6.5".

I then placed other dimension objects and was able to directly obtain all of the measurements that I needed.

This procedure works very well.

Croc,

I would be interested to know if this procedure would work for your situation and how to compares to your solution.

Cheers, J
Using Visio 2019, part of Office 365 on Windows 10

wapperdude

@Jennifer:  you can refine your technique slightly that might make scaling the picture easier and more accurate.  After placing the pic on the drawing page, setting aspect ratio you could then...
  1) add two connection points, one at each end of your known dimension.  Now glue the dimension shape to these points.  The shape will change its value as you scale the image.  Scale until you get desired reading.

  2) another consideration would be that the connection points should be placed one either a horizontal or vertical line.  Drag a guide line onto the page, then rotate the image until the known dimension is perfectly aligned horizontally or vertically.  The added connection points should align with the guideline.

Wapperdude
Visio 2019 Pro

Jennifer

Quote from: wapperdude on December 10, 2016, 08:19:39 AM
@Jennifer:  you can refine your technique slightly that might make scaling the picture easier and more accurate.  After placing the pic on the drawing page, setting aspect ratio you could then...
  1) add two connection points, one at each end of your known dimension.  Now glue the dimension shape to these points.  The shape will change its value as you scale the image.  Scale until you get desired reading.
I actually came up with an even better procedure. After placing the dimension shape on the known dimension, I place a second dimension shape to the full width of the shape. This is assuming that the known dimension in horizontal. Now I can calculate the exact scaling factor.

Suppose the known dimension is 6.5" and the dimension shape shows 5.57". My scaling factor is then 1.165. If the dimension shape shows the full width of the image as 9.45, then the true width is 9.45" * 1.165 or 11.008". If I have the aspect ratio locked, all I have to do is set the width field in the Size & Position table to 11.008 and the whole image is properly scaled.  8)

Quote2) another consideration would be that the connection points should be placed one either a horizontal or vertical line.  Drag a guide line onto the page, then rotate the image until the known dimension is perfectly aligned horizontally or vertically.  The added connection points should align with the guideline.

What??? Are you saying that I cannot take a photo and keep the camera level?

Seriously, this is a great suggestion. Again, I would offer a slight modification. Just draw a line from one end of the known dimension to the other. Then look in the Size & Position panel and record the Angle setting. Then select all, group, rotate by 0-that angle, and ungroup.

I just tried that and my photo's angle setting was -0.4914. But I did take the photo with both the object and the camera sitting on a table. If it had been hand held, it would probably been off more than that.

Excellent suggestion. Thanks.
Using Visio 2019, part of Office 365 on Windows 10

wapperdude

Re Suggestion #1:  brilliant!

Re Suggestion #2:    ;D

Time to go sip a latte.
Wapperdude
Visio 2019 Pro

Jennifer

Thanks. After a little more fiddling, I concluded that since I am using the length and angle settings from the Size & Position panel, I really don't need the dimension shapes. A simple line works just as well and is easier to position. I also discovered a few other "enhancements" to the procedure to reduce errors and improve accuracy. I wrote it up for myself for future reference, so I thought I would share it here in case it is of use to anyone else.

Here's the procedure. It's best to do this before placing any other objects on the image.

1. Setup

  • Obtain a good image of the object that is not distorted. Take the photo from as far away as possible using the camera's zoom feature to get the object to fill the screen. This will minimize the parallax distortion.  Use a tripod whenever possible and try to have both the object and the camera as close to horizontal as possible.
  • Obtain at least one accurate measurement (K) on the actual object. It works best if this measurement is one of the longer dimensions in the photo. This will be referred to as the "known dimension".
  • Create a Visio page that is large enough to accommodate the image at full size.
  • Paste the image onto a Visio page.
  • Crop as necessary.
  • Change the Protection setting to preserve the Aspect Ratio.

2. Correct for Skew.

  • Draw a line (L1) across the entire image from left to right. It's OK if it extends beyond the edges of the image. It's a good idea to label this line "L1".
  • Change the color and weight of L1 so that it is easily visible. Yellow is a good color for dark images.
  • It might be helpful to add an arrowhead to the end of the line to make sure that it continues to be drawn from left to right. It must be an end arrowhead and it must be on the right.
  • Select the largest (widest) object in the image that should be perfectly horizontal, such as the base or a window frame.
  • Move L1 close to that object and adjust the angle so that it is aligned with or parallel that object. Zoom in to ensure that L1 runs right through the endpoints of the object closely as possible.
  • In the Size & Position panel, make a note of the Angle setting of L1 (theta).
  • Calculate the de-skew angle (= 0-theta).
  • Group the image and L1.
  • In the Size & Position panel, change the Angle setting for the group to 0-theta (the de-skew angle). The entire image should be perfectly horizontal.
  • Ungroup.
  • Select L1. In the Size & Position panel, the Angle setting should be zero.
  • It's probably a good idea to keep L1 around. If you will be printing the image and don't want it in the printout, assign it to a non-printing layer.

3. Scale the Image.

  • Draw a line (L2) from one end of the known dimension object to the other. It's a good idea to label this line "L2".
  • Zoom in to get the endpoints of L2 as close to the actual endpoints of the known dimension object as possible.
  • Make a note of the length of L2 (L).
  • Calculate the scaling factor (=K/L).
  • Group the image and L2 (& L1).
  • Set the Protection for the group to preserve the Aspect Ratio.
  • In the Size & Position panel, make a note of the Width (W1) and Height (H1) settings.
  • Calculate the scaled width (W2 = W1 x K/L).
  • In the Size & Position panel, change the Width setting for the group to W2.
  • Note that the Height setting is also scaled proportionally.
  • Ungroup.
  • Select L2. In the Size & Position panel, the Length setting should be K.

The image is now scaled to actual size. Any objects placed on the image should reveal the true dimensions.
Using Visio 2019, part of Office 365 on Windows 10

wapperdude

Visio 2019 Pro