Error in shape match
Chrille from Sweden  [1 posts]
15 year
Hi, I get a very odd error when using the shape match module. I have an image of three digital numbers. It works good until two of the numbers beside each other are the same. Then the SHAPE_PATH variable only have one of them.

This image only gives me: 2.gif,4.gif

is there any solution to this problem? Or is there a better way to get the images found by shape match?

Thanks/ Chrille
Anonymous 15 year

Yes, the SHAPES_PATH is really a lookup table for the main shapes array. See the documentation at


and pay attention to the content of SHAPES. The SHAPES_PATH is really a database or sort that will ONLY include the unique names referenced by the SHAPES array. This is to ensure that the list keeps small.

So in order to determine what paths to what objects have been detected you need to loop through the shapes array and use its information into the SHAPES_PATH array. An example is on that documentation page on how to do this in VB.

Davide Fabbri from Italy  [8 posts] 14 year
Hello Steven, I have a few problems with shape matching:
- I have trained the shape matching algorithm with four samples
- I have checked the checkbox "create shapes array"
- the four samples are correctly recognized ( I can see the green box around each samples )
- I can send correctly the values of the variables SHAPE_FILENAME, SHAPE_CONFIDENCE, SHAPE_SIZE etc. via the OSC_SEND_VARIABLES module
- I can send the value of the array SHAPES via OSC_SEND_VARIABLES
- but when I send the variable SHAPES_PATH via OSC_SEND_VARIABLES I receive an empty string
- I used the 'api approach' to retrieve the value of SHAPES_PATH with no success ( I always get an empty string, the value of the other variables is received correctly )
- in fact the variable SHAPES_PATH has always an empy value
- I repeated the above steps with RR and RR 2.2.4

Where is my mistake ( any help is appreciated )?

P.S. attached the training images for shape matching and the robo file

Davide Fabbri from Italy  [8 posts] 14 year
Hi to all,

- I'm still having problems with the variable 'SHAPES_PATH' ( in shape_match module ), it is not initialized ( it is always empty ) while the array 'SHAPES' is correctly initialized ( it contains the 'matched data' ). I repeated the above process several times, with different sets of training images... ( attached an image of the variables )

-  On the contrary the fiducial module ( which is similar to shape_matching ) is working ok, The variables FIDUCIALS and FIDUCIALS_PATH are correctly initialized

P.S. documentation of shape_match says that SHAPES array contains:
3           X min coordinate of bounding box
4           Y min coordinate of bounding box
5           X max coordinate of bounding box
6           Y max coordinate of bounding box

my testing shows that elements 3-6 are as follow:
3           X min coordinate of bounding box
4           X max coordinate of bounding box
5           Y min coordinate of bounding box
6           Y max coordinate of bounding box

could someone verify this?

Anonymous 14 year

We synced the shape matching with the way the fiducial module works which seems to have corrected the issue of grabbing the SHAPES_PATH via the OSC and API.

The x min/max, and y min/max order has been verified as you noted. We have updated the documentation to reflect that order.

Please try 2.2.9 for the fixes.

Thanks much for your note. Great debugging!! Helps us identify the issue very quickly!

Davide Fabbri from Italy  [8 posts] 14 year
Thank you very much STeven, version 2.2.9 is ok.

This forum thread has been closed due to inactivity (more than 4 months) or number of replies (more than 50 messages). Please start a New Post and enter a new forum thread with the appropriate title.

 New Post   Forum Index