Monday, June 2, 2014

Measuring bike "fit" using a digital camera

When I was a sophomore at UC Davis in 1983, I purchased a brand new Centurion Pro Tour 15. It is a beautiful bike and I still have it and love it. I think it was $550.00 at that time. Last year, when I turned 50 and my bike turned 30,  I rode it on a cross-country tour. I blogged about that ride here.

The reason I love that bike so much is that it is a really, really comfortable ride. The bike fits me quite well and I can pedal for hours without getting sore other than the standard fatigue and muscle soreness from all the work I am doing.

In any event, I wanted to measure the "fit" of the bike to help me compare it with other bike frames I am considering buying. I wanted to know how far off the ground the bottom bracket is, how far up above and set back the saddle is, what the angle of the seat tube is, how far up and forward the handle bars are, what the wheel base is, etc, etc.

I decided to try to use a digital camera to measure the bike "fit". I believe the approach works remarkably well.

Photoshop image of bike with various guidelines drawn in red.

Taking a picture of your bike

Its really important to take a "proper" picture of your bike.

The photo above shows the original color image of the picture of my Centurion Pro Tour. I made a few mistakes when I took it. The first is obvious. The background wasn't the best. It would be much better if I had hung a white sheet or some solid, light color sheet against which all the components of the bike would stand out. So, thats my first piece of advice. Choose a constant color background.

Also, be aware of shadows and direction of lighting. It is probably best to illuminate the bike with a bright light source near the camera. Diffuse light is of course better. A lot of light from an oblique angle from one side of the bike can cause non-uniform illumination on key components facing the camera and will result in making it harder to judge the 'center' of things like wheel hubs, cranks, etc.

Next, make sure the bike is standing perfectly vertical. You want the center plane of the bike frame to be as close to exactly parallel to the camera's image plane as possible.

Next, you want to "flatten" the bike in the image as much as possible. You do this by making sure the distance between the camera and the bike is large compared to the "thickness" of the bike. But, the further you move the camera away from the bike, the smaller the bike will be in the image. It will occupy a smaller number of pixels and any measurements based on counting pixels will have greater error. So, its best to have a digital camera with a high optical zoom, say 20x or more and a large number of pixels, say 10 Megapixels or more.

Next, you need to include something in the picture that you know the exact length of (a scale cue) so that you can later calibrate Photoshop's measuring tools. If you look closely at the top tube in the above picture, you see a white strip of paper hanging from it. That paper is cut to to exactly 12 inches in length from top to bottom. Once I have the image in Photoshop, I can use tools there to count the number of pixels in those 12 inches and from that, calibrate the physical size of a pixel. Again, its really important that that scale cue is as nearly parallel to the camera's image plane as possible.

Finally, you want the bike's front and rear axels (center of the wheels) to create an as close to perfectly horizontal line as possible. You don't want the image of the bike rotated relative to the horizontal line. On the other hand, once in Photoshop, you can measure how far off the horizontal it is by drawing a horizontal guide and then having Photoshop rotate the image slightly to correct it. 

I mounted my camera on a tripod that also has a small level on it. I made sure the tripod was level, stood about 20 feet (more would have been better) from the bike and tried to position the camera so that the center line of the camera's lens pierced the bike frame's plane at about the geometric middle of the frame. I then adjusted the zoom so that the bike filled the image. I took several pictures, keeping the one that was most in focus.

Measuring things in Photoshop

First, a disclaimer. After doing all this work with a very high quality image in photoshop, I have somehow now lost that image and have only some lower resolution PDF files (with red-lines over-written for different geometric components). So, the images in the examples here are kind of fuzzy. Your own images I am sure will be much cleaner and clearer to work with. This just gives you an example of how to take measurements.

After bringing the image into Photoshop, the first thing you will want to do is probably crop the image to eliminate wasted space in the image an center your bike in the image. After that, you will want to set a custom measurement scale. In the panel options for the Info window, set Mouse Coordinates to Pixels. Then, using the ruler tool, measure your scale cue.

Using Photoshop ruler tool to measure scale cue
The upper left corner of the Info window displays an angle, (A), and a length, (L). The length represents the length of the line between Start and End points measured in units of pixels. In this example, it comes out to 606.6 pixels.

Next, you set a custom measurement scale by going to Analysis->Set Measurement Scale->Custom


Photoshop accepts only integral values for the pixel length entry. But, notice that the window now displays the scale as "607 pixels = 12.0000 inches." Save your image.

With the measurement scale set, you can now use the rule tool to measure both lengths and angles on your bike. But, when using the ruler tool, be sure to check "on" the "use measurement scale" option for the ruler.

On other thing you may want to do is ensure that a line drawn between front and rear wheel hubs of the bike is perfectly horizontal. In other words, make sure the image of the bike is not rotated relative to the horizontal. To do this, choose the ruler tool and then draw a ruler between the center of the front and rear wheel hubs. The Info window will show what the angle of that line is. It might show something like 0.5 degrees.

Newer versions of Photoshop have an option to 'straigthen' a ruler. If you have this option, use it. Its the simplest way to rotate the image so that the ruler you drew is perfectly horizontal. On the other hand, if you don't have this option, you will have to rotate the image. So, find the controls to rotate the image (by an arbitrary angle) and enter twice the negative of the angle you measured. Why twice? Well, that's because Photoshop will rotate the image about its center. And, the angle you measured is relative to the center of your front wheel hub. Assuming your bike is centered in the image, your front wheel hub is off to the left (or right) and so you need to rotate the image about its center through a larger angle.

You can use Photoshop's "guides" to set horizontal and verticle guidelines that intersect at key points such as the center of each wheel hub and the center of the bottom bracket/cranks. Doing this allows you to ensure that each time you draw a ruler originating or terminating at one of these points, you can make it "snap" to the same point making your measurements more consistent.

As an example, here is a measurement of head tube length and angle.



Note that I have set the Panel Options for the Info window to show the current scale. However, also note that the Length, (L) measurement in the upper right of the Info window is not using the measurement scale. It is using the image's default scale. The correct length measurement is shown in the toolbar menu near the top of the image (L1) of 7.4 inches. The head tube angle is measured 71.5 degrees.

The angle measurements in Photoshop are always from the positive X-axis (e.g. from a horizontal line moving to the right).

After doing this exercise, I later found an on-line reference for the 1984 Centurion Pro Tour 15 and can confirm the measurements turned out to be less than a quarter percent different from the published specs.

Comparing with another frame

The Centurion is a beautifully chromed lugged steel frame. I really like a lugged steel frame. In 2013, I spent some time looking for a comparable frame but designed for modern components such as 700c wheels and 130mm rear hub spacing.

I took a close look at the 2012 Bianchi Dolomiti. To compare it to my Centurion, I used on-line frame geometry specifications for the 59cm Dolomiti. Using the bottom bracket as a sort of "origin" upon which to overlay the two frames, I worked backwards in Photoshop drawing lines for lengths and angles of various Dolomiti tubes. The result is pictured below. The Centurion is in red and the Dolomiti is in black.

Comparing Centurion (red) with Bianchi Dolomiti (black).
The head tube angle on the Dolomiti is a bit steeper, the wheel base is quite a bit shorter due to shorter chainstays. The seat tube angle on the Dolomiti is a bit more relaxed too and a bit higher. On the other hand, the seatstays on the Dolomiti are a bit steeper. But, the top tube length and seat tube height are a pretty close match. I think I would have been happy with the 59cm Dolomiti.

In the end, I decided to go for the 59cm Soma San Marcos (geom). I just did my first double century, the Eastern Sierra Double, on that bike and think it is turning out to have been a great choice.

Getting a true "3D" model of your frame

A friend of mine works at Google and I happened to ask him about how to maybe use multiple views of my bike frame to build up a 3D model of it. He suggested something called Voxel Culling. The way it works is that you sort of hang the frame by a string in front of a camera and then let the frame twist around a full revolution while the camera snaps a slew of images of it (maybe even a video). Then, feed all these images into some special 3D reconstruction software designed for this purpose. More on this in another post.

No comments:

Post a Comment