# Revision history [back]

### Shape matching for a total newbie

Hello Everybody,

I've been asked to participate into an academic psychological project. The area I should help would be in trying to evaluate a series of tests through computer vision. The evaluation is quantitative and qualitative. In this first phase I'm focusing just in the quantitative analysis which it should be "easier". I would like to implement this in python, but the problem is that I don't have any knowledge in CV.

To illustrate this better here is a screenshot: https://dl.dropbox.com/u/239592/region01.png

Each octagon is an answer, and the shape I have to identify is formed by the combination of straight lines connecting the numbers. There are 6 possible lines (1-2, 1-3, 1-4, 2-3, 2-4, 3-4), so there should be 2^6 = 64 possible shape patterns (63 valid ones, excluding the blank one).

What I have to do is a count on: - How many different (unique) shapes are within a test - How many repeated shapes are - How many mistakes (ie, circles, a "T" shape, curves or anything that doesn't match the 63 accepted ones).

There are some acceptance criteria that hasn't been defined yet, for instance a very short line shouldn't be accepted, and a long one that even goes over the numbers could be accepted.

I first thought of identifying straight lines with HoughLinesP, but it doesn't seems to work well, since the lines are human made and therefore not perfect.

I should perhaps first decompose the full test into partial images (per answer), to analyze them in a separated way. I don't know how to do this, I thought of applying some sort of color mask during the scanning process so I can just keep the white regions.

For patterns identification I've read something about SIFT and cvMatchTemplate (keep in mind that I'm totally new to this CV area), but I'm not sure if these approaches could effectively solve the problem.

I think that some sort of artificial intelligence and training is needed but perhaps there are easier approaches.

Any help, guidance or even example code would be greatly appreciated!

Thanks a lot!