Intereting Posts

(Certain) colimit and product in category of topological spaces
Prove that there exists $n\in\mathbb{N}$ such that $f^{(n)}$ has at least n+1 zeros on $(-1,1)$
Variance of the random sum of a Poisson?
Arrangement of Numbers
Question regarding integral of the form $\oint\limits _{s_{R}}e^{i\cdot k\cdot z}f\left(z\right)dz$.
When do free variables occur? Why allow them? What is the intuition behind them?
Does the formula $\sqrt{ 1 + 24n }$ always yield prime?
A non-losing strategy for tic-tac-toe $\times$ tic-tac-toe
How to derive the Golden mean by using properties of Gamma function?
What is precisely the definition of Elliptic Partial Differential Equation?
Can a tetrahedron lying completely inside another tetrahedron have a larger sum of edge lengths?
Exhibiting an isomorphism between two finite fields
If $\sum_{n=1}^{\infty} a_{n}^{3}$ converges does $\sum_{n=1}^{\infty} \frac{a_{n}}{n}$ converge?
Embeddings $A → B → A$, but $A \not\cong B$?
Must we use induction to prove a statement for all integers

What method should I use to calculate the error between a given perfect shape (e.g. circle, triangle, rectangle etc.) and a freeform shape drawn by the user, which more or less closely matches the perfect shape?

The application context is a program that measures the precision of users hand-drawing shapes displayed on a touch screen. The users try to redraw the shape that is shown on the screen with the finger or a stylus pen and because users are not perfect, the drawn shape does not completely overlap with the given one. I would like to measure the difference or the error between the perfect shape provided by the application and the imperfect shape drawn by the user.

Thanks for your help.

- Penrose's remark on impossible figures
- Centroid of equilateral triangle
- Distance of a test point from the center of an ellipsoid
- Volume of a hypersphere
- Why isn't the volume formula for a cone $\pi r^2h$?
- Vector path length of a hypotenuse

- Pythagorean Theorem Proof Without Words (request for words)
- What is the most elegant proof of the Pythagorean theorem?
- Two congruent segments does have the same length?
- The PDF of the area of a random triangle in a square
- Shortest distance between a point and a helix
- How to get the co-ordinates of scaled down polygon
- Transform a plane to the xy plane.
- Formula for solving for Cx and Cy…
- Least sum of distances
- How to calculate the area of a polygon?

One common measure is the Hausdorff distance. However, I think in your case

the Fréchet distance might be best, as it is specifically tailored to curves (rather than sets).

Computing this distance has been the focus of several recent papers in computational geometry, one with the interesting title “Homotopic Fréchet distance between curves, or Walking your dog in the woods in polynomial time”!

This is not as whimsical as it first appears, because

“the Fréchet distance between two curves is the minimum length of a leash required to connect a dog and its owner.”

The method you should use depends strongly on your reasons for making measurements, and on what you plan to do with the measurements. Absent such details, mathematical arguments for one method or another seem bootless.

That said, here are three methods you might consider:

- report maximum error (eg, length of longest vector from pattern curve to result curve, normal to pattern or result)
- report sum of squared error (eg, at each pixel of pattern, measure length as in previous item, and add up squares of all the lengths)
- report absolute value of area between pattern and result (eg, on each scan line of pixels, count pixels between the curves, and total the counts.)

If you divide by curve length to normalize the result, the third method is nearly equivalent to reporting average absolute error; but counting pixels on scan lines may be an easier calculation than finding error-vector lengths.

Thanks for the answers.

So I finally opted for using the exclusive-OR area of the pattern shape and the drawn shape (i.e. the combined area of the two shapes minus their intersection) as the error measurement. It seems to work fine, as long as the shapes overlap (if not, I define the error to be infinite).

- Sum of odd numbers always gives a perfect square.
- Number of ways to distribute indistinguishable balls into distinguishable boxes of given size
- Rogers-Ramanujan continued fraction in terms of Jacobi theta functions?
- Is the reciprocal of an analytic function analytic?
- A characterization of trace class operators
- “It looks straightforward, but actually it isn't”
- Infinite number of composite pairs $(6n + 1), (6n -1)$
- Field axioms: Why do we have $ 1 \neq 0$?
- Probability distribution for the position of a biased random walker on the positive integers
- Longest antichain of divisors
- Prove$ L^2$ inner product satisfies positivity
- Why is $\left(e^{2\pi i}\right)^i \neq e^{-2 \pi}$?
- Prove that a nonzero integer p is prime if and only if the ideal (p) is maximal in Z.
- second order differential equation with Green's function
- Is there a simple proof of Borsuk-Ulam, given Brouwer?