Pattern recognition of basic shapes in Rev

David Bovill david at vaudevillecourt.tv
Thu Aug 19 12:45:36 EDT 2010


On 17 August 2010 19:30, Randall Reetz <rlreetz at gmail.com> wrote:

> I am working on two such filters.  The first is a brute force recognizer
> looking for matches to standard shapes (point, line, angle, triangle,
> rectangle, polygon, oval, conic and cylindric sections) and how closely a
> user drawing matches platonic forms of these (exp.  right and equilateral
> triangles, square, right rectangle, golden rectangle, parallelogram, circle)
> at any rotation.   The second filter is one I have been working on for 15
> years and is a universal pattern engine which does the same as above but
> without a set of arbitrarily pre-defined target shapes.  From the
> self-evolving AI perspective from which I work, I consider the first filter
> set cheating and embarrassing (but hey, it is far easier to pull off).
>
> By the way, anyone can copy a code library or algorithm.  I am always
> interested in the ways different people go about solving problems like this.
>  The way I attack a problem is by collecting salient data.  What can I know
> about these user created polygons (number of points (or line segments),
> vertice angles between segments, relative segment lengths, relative distance
> of each vertices from the object's center of area, open or closed, etc.)?
>  Once this data is collected and stored for all user polygons, it can be
> compared with the same data collected from platonic shapes.
>
> How would you go about solving this problem?
>

I'd Google for a library :)

But that's because it is not the problem I'm interested in, but a tool that
would improve the user experience. It's also because I'm pretty sure it's a
problem that soon will be addressed by the gesture recognition stuff in the
OS, and developing my own hack would well just be another hack.

If I were to do it now, my guess would be to avoid logical solutions based
on knowledge of geometry, and to take one of the C++ based genetic algorithm
libraries out there and train it on a set of user data. I did play with both
neural networks and GA's in MetaCard, and used some of that work in music
composition. Certainly very interesting areas - but right now I just want
the user to be able to draw polygons with their finger :)



More information about the use-livecode mailing list