I'm using 'Object recognition', and 'shape', to examine screw heads.
Whenever I get a fail (conf<75%), I take a snap-shot of the head and add it to the trained database.
What I'm trying to get a feel for, is how does the size of the 'roborealm.shape' file affect things.
For about 10 screws, it might be 900kB . Is that tiny, large, way too big?
Each screw examination is within an if-statement.
What I would like to know i;
1. will a larger shape file use more 'resources'? I'm only worried about general speed, and not the matching time in an instance.
2. what is a comfortable size .shape file that RR can work with?
3. I'm trying to limit the number of snapshots per screw to about 10. Is this advisable? How about 20, or 50? snapshots to cover every permutation so that I can up the confidence threshold?
The snapshots are only about 3kB each. I find the matching fairly quick at the moment, except when it's matching two screws in one image with a common database.
Including email response in case others have the same questions:
There isn't an easy answer to what you are asking. There isn't an X limit where suddenly things stop working ... the module will take hundreds of images but several things will start happening while this is increased:
1. Your memory will eventually run out because all the shape data (plus the actual bitmap image) will eventually cause your system to start swapping out to disk and really slow down the recognition.
2. The number of images does increase the search time .. but not linearly and not equally for all images. Some images based on their content will take slightly longer than other images. While this is happening, again, the recognition will start to slow and eventually crawl at a very slow rate which will make it unusable. Its not that it will suddenly stop but just get slower and slower.
In terms of number of images, again, that depends on how the image can change. 10 seems like plenty to me but if that doesn't get the job done, then you'll have to increase it. That's why it is very important to test your recognition on as many images as you can.
The shape file can be a gigabyte big and with enough memory and processing power, you can still get very good fps out of it.
Note that the original bitmap of the object is also stored in memory and in the shape file which is what makes it quite large ... but most of that is not used during recognition until right at the end to do a final byte by byte verification. As this is only performed as the very last step it will not slow things down much ... but if you start adding many images in you will eventually see the fps slow.
Normally in these cases (identifying screws) we look for a higher level attribute that we can process the image for and don't use object recognition to do that. Its not that its wrong, but you can sometimes get much more reliable and faster results if you can tune filters specific to the object you are looking for, i.e. shape, texture, color, lighting, etc.
In some cases when speed does start to slow, simply erasing those parts of the test image before recognition will also increase speed since you essentially cause a part of the image to have no features to process. But this requires a lot of knowledge about where you'd expect the object to appear.
Also, if you remove testing for scale or rotation, that can also dramatically speed things up. Lots of tricks and things to play with in these cases. There isn't really a right or wrong way to do things which is why this type of work is a bit of an art form.