We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSyntax Questions › quantifying the difference between shapes
Page Index Toggle Pages: 1
quantifying the difference between shapes (Read 812 times)
quantifying the difference between shapes
Dec 1st, 2009, 9:25pm
 
I'm new to Processing and am exploring it as an environment to create experiments on the way people produce (i.e. draw) and visually process shapes. For the experiment I have in mind, I would need to quantify the difference between two subject-drawn shapes, e.g., two lines, ellipses, squares. One way to do that would be to use some algorithm to morph one into the other, keeping track of the total change required by the morphing process. I've looked at threads on morphing, but they seem to involve morphing between pre-defined objects. Is there some way to morph between subject-drawn objects of a given type, or otherwise quantify their difference? (Finally, if there's a better place here to have posted this query, please let me know.)
Re: quantifying the difference between shapes
Reply #1 - Dec 2nd, 2009, 12:56am
 
Morphing is something that isnt easily done in processing. Not like you are used to do it in flash vor example. I also think even if it is not the best way to figure out the difference between 2 shapes.
What exactly do you want to check ?
of much of the same space they occupie? thats probably not that hard. But if you want to check if they look alike i bet it really is.

For example. 2 circles one is big on the left side of the screen, one is small on the right side. are they similar or not at all?

is the small ball more similar to a triangle at the same position because they share some of the space used ?

So like i said, to tell if they really look alike (circle=circle) seems to be hard to me. but if you lets say just want to draw 2 shapes and then later show just the parts where they overlap its much easier.
Re: quantifying the difference between shapes
Reply #2 - Dec 2nd, 2009, 3:00am
 
Either the shapes are vector-based (or node-based), and you may compare the position of the vectors / nodes between two shapes,

or they are raster pictures, and you may compare the pixels[] array of each drawing (a pixelate algorithm could help, for example).
Re: quantifying the difference between shapes
Reply #3 - Dec 2nd, 2009, 5:15am
 
Probably pixel based as he mentioned that he wants to explore how people draw. Pixeldrawings are way more intuitive compared to vector drawings, especially when realized in processing i guess.
But tell us a bit more about your project and we probably can suggest you a good way to do it
Re: quantifying the difference between shapes
Reply #4 - Dec 7th, 2009, 10:47am
 
Sorry for the late reply -- I had thought I was going to get email notifications of responses because I clicked the box below, so since I didn't get any I assumed I hadn't gotten any replies Smiley

The experiment is actually about the way that communication forms evolve with usage. Since it's much easier to work with drawing than with sound, I'm using the drawing of shapes as meanings rather than using sounds as meanings, as in spoken language. Think Chinese characters, but simpler. The question concerns how these characters evolve over the course of time when they get close enough to each other to be easily confused.

The 'characters' that subjects will be taught to use just consist of simple combinations of lines, curves and shapes, e.g. an ellipse with a straight horizontal line drawn across the top. Since I'm interested in the evolution of these characters as subjects begin to use them, I need to find some independent mechanism to measure similarity two instances of the 'same' character. As Cedric notes, the definition of 'similarity' of course is entirely dependent on the dimensions chosen, and I would want to ignore dimensions such as precise position on the screen, for example.
What would be most useful would be the following measure:
For the component shapes within a character (in the example above, the ellipse and the line), I would like to measure the change necessary to morph one corresponding shape into another. This would lump a number of dimensions into the similarity measure: e.g., angle, relative size, curvature. So for two instances of the ellipse plus line character, I would like to find the separate similarities between the two ellipses on the one hand, and the two lines on the other.

There are other measures I would like to include, such as the relative placement of the shapes within a character, but I don't think I need help with that. Thanks very much for any help or advice you can provide!
Page Index Toggle Pages: 1