tags:

views:

63

answers:

2

I have a reference set of n points, and another set which 'approximates' each of those points. How do I find out the absolute/percentage error between the approximation and my reference set.

Put in other words, I have a canned animation and a simulation. How do I know how much is the 'drift' between the 2 in terms of a single number? That is, how good is the simulation approximating the vertices as compared to those of the animation.

I actually do something like this for all vertices: |actual - reference|/|actual| and then average out the errors by dividing the number of verts. Is this correct at all?

+1  A: 

If you sum the formula you have over all vertices (and then divide by the number of verts) you will have calculated the average percentage error in position for all vertices.

However, this percentage error is probably not quite what you want, because vertices closer to the origin will have a greater "percentage error" for the same displacement because their magnitude is smaller.

If you don't divide by anything at all, you will have the average drift in world units, which may be exactly what you want:

average_drift = sum(1->numvertices, |actual - reference|) / numvertices

You may want to divide by something more appropriate to your particular situation to get a meaningful unitless number. If you divide average_drift by the height of your model, you will have the error as a percentage of the model size, which could be useful.

If individual vertices are likely to have more error if they are a long distance from a vertex 'parented' to them, as could be the case if they are vertices of a jointed model, you could divide each error by the length of their parent joint to get the average error normalised for joint orientation -- i.e. what the average drift would be if each joint were of unit length:

orientation_drift = sum(1->numvertices, |actual - reference| / jointlength) / numvertices
fuzzyTew
+2  A: 

Does this measurement really have to be a percentage value? I'm guessing you have one reference set, and then several sets that approximate this set and you want to pick the one that is "the best" in some sense.

I'd add the squared distances between the actual and the reference:

avgSquareDrift = sum(1..n, |actual - reference|^2) / numvertices

Main advantage with this approach, is that we dont need to take apply the square root, which is a costly operation.

Magnus Skog