1
$\begingroup$

I have an equation for an arbitrary shape (circles, spirals, squares, etc) that I am trying to trace on an ipad. Assuming that the ipad records my tracing lines as a set of x,y coordinates how do I measure how well I was able to trace the lines? I understand that there might be many different measures of "wellness", but I am having trouble thinking of an algorithm that can't be exploited. For example, originally I thought to calculate the closest distance from all the points to the shape and calculating the mean of the distance for a score, however I realized that I can just place one point very close to the circle and it can give you a high score.

For example, this trace would return a better score than this trace. Is there any known algorithms in literature that deals with this?

  • 0
    you should apply the mean to the distance **squared**: that's a classical measure of approximation .."wellness" [re. Least squares](https://en.wikipedia.org/wiki/Least_squares)2017-02-10

2 Answers 2

0

It depends a lot on what you consider to be accurate. I presume you don't care how the tracing is done; the score is supposed to be the same for the same trace regardless of the traced position over time. $ \def\lfrac#1#2{{\large\frac{#1}{#2}}} $

Now if you don't care about smoothness of the tracing, then you could use the following:

Let $S,T$ be the sets of pixels for the figures you wish to compare.

Let $d(S,T) = \lfrac1{\#(S)}\sum_{p \in S} d(p,T) + \lfrac1{\#(T)}\sum_{p \in T} d(p,S)$,

  where "$d(x,U)$" denotes the minimum distance from point $x$ to set $U$.

This measure penalizes deviations fairly, roughly proportional to the size of the average deviation rather than the maximum deviation. It also avoids being affected if you use too many or too few pixels to trace the figure. Also, it works equally well for figures with disjoint regions. Finally, it is stable with respect to human errors and preserved under translation and rotation and scaling, so one can use it to measure accuracy of a person and not just a particular tracing.

  • 0
    Thank you, I think this equation fits my criteria well.2017-02-12
  • 0
    @KanKawabata: You're welcome! Hope it works nicely for your intended purpose!2017-02-13
0

You might try the Hausdorff metric. Compute

  1. The maximum of the distances from your points to the shape.
  2. The maximum of the distances from the points of the shape to your points.

and then take the maximum of those.

  • 0
    Hmm, that seems promising, however it only measures the extremes of the trace lines. I could be drawing perfectly for 90% of the time but a slight jump would ruin it. While I could be tracing very shabbily but without any jumps and do better. I guess there's no objective way to really say which one is better.2017-02-10