Circle Fitter

Circle Fitter

A circle fitter track is a tool for fitting circles and finding their radii and centers. It requires at least three data points, but can fit a circle to any number of points. Points can be marked manually or attached automatically for point masses. Once a circle is fit you can instantly move the coordinate system origin to the circle center(s) with a menu item or calibrate the scale by entering a known radius.

To create a circle fitter, click the arrow on the Measuring Tools button , then choose New|Circle Fitter from the popup menu. Multiple circle fitters can be created as needed.

1. Fitting a circle

At least three data points are required to fit a circle. When a circle is fit, its radius and center position are displayed on the toolbar as shown below. When a data point is selected, its position is also displayed.

circle fitter toolbar

There are two ways to create data points: (a) mark the points manually using the mouse, or (b) attach the points automatically to point masses. The marked and attached data points are weighted equally when fitting a circle.

2. Marking data points

To mark points manually, shift-click a video frame repeatedly along a circular path. You can mark as many points as you wish; all points are weighted equally in the fit. To move a marked point, select it and drag with the mouse or nudge it using the arrow keys. Also, for marked points you can select them and enter a desired position directly in the x or y toolbar fields as shown above.

3. Fixed vs unfixed points

By default, marked data points have a fixed position--that is, they are identical in all frames (steps). This means that every step contains the same data points (and resulting best-fit circle), and moving a point in any step affects all.

Of course there are many videos in which a circular object or path of interest changes with frame or time. You can track those changes with marked points only if the circle fitter is first unfixed. To unfix a circle fitter, uncheck the Fixed Position checkbox in its track menu. (Note: it is often easier to track changing circles with attached data points as described in section 4.)

Once the circle fitter is unfixed, marked data points behave as follows:

4. Attaching data points

The circle fitter can automatically create and attach data points to existing point mass tracks including centers of mass, particle models and data tracks. Marked data points (section 2) are not affected and continue to be included in the fit along with the attached points.

To attach points, open the Attach Points dialog shown below by choosing the Attach Points... menu item from its track menu.

circle fitter attachments dialog

There are two options for attaching data points:

circle fitter attachments dialog circle fitter attachments dialog

The fields define the range of frame numbers to which data points will be attached (if the point mass positions are marked). If at least three points are attached then the circle will be fit. Note: the maximum frame count is 20 since little is gained by fitting circles to large numbers of data points.

The frame numbers can be absolute or relative:

5. Viewing and selecting data points

The circle fitter toolbar includes a button that displays the number of data points in the current step and enables you to identify and select the points and to copy point positions to the clipboard. To see a popup menu listing all points, click the data points button. Moving the mouse over a menu item temporarily selects the corresponding point on the video so you can easily find it; selecting the menu item leaves the point selected. Choose Copy to Clipboard to copy all point positions to the clipboard for pasting into spreadsheets or other documents.

selecting circle fitter points

6. Moving the coordinate system origin to the center of the circle

To move the origin of the coordinate system to the center of the circle, choose the Move Origin to Center item in the circle fitter's track menu. This is particularly useful when the center of the circle is outside the video frame (e.g., a video of a pendulum bob that does not include the support). If the coordinate system's origin is not fixed you will be given the choice to move the origin to the center in This Frame or in All Frames.

7. Calibrating the coordinate system scale by setting the radius of the circle

You can calibrate the scale of the coordinate system by setting the radius of the circle to a known value. To do so, choose the Set Radius... item in the circle fitter's track menu. If the coordinate system's scale is not fixed you will be given the choice to set the radius in This Frame or in All Frames.

8. Locking the circle fitter

Locking the circle fitter prevents any changes to the marked data points. Attached points can still affect the circle, however. Lock the circle fitter by turning on the Locked property in its track menu.