For almost a week now I did work a fair bit on my new CTS client and in the same time doing some revamp on the CTS code. Trying to reclaim some of the flash memory so I can add more features.
Took this opportunity to improve the connected component labelling (connectedness) algorithm too.
The main problem is implementing an optimal connected component labelling (connectedness) in only one pass, restriction caused by limited memory available (only 8 Kbytes or RAM). When the image is clean and there is no noise just a small number of components will be created and only a small amount of memory will be used. However, in some extreme light condition (low light or too strong direct light) there may be a large number of not connected components and/or a large number of connected components which will use a lot of memory to catalog. In this example there are around 45 components in 7 blobs.
Anyway, not planning to go into boring details, I was looking for a way to do dynamic allocation on LPC1343. While there may be a way to use the “malloc”, the cost of doing so is too high: will need to change from new lib to redlib and will increase the size of my code too much, also will slow down the entire tracking. Mind you that I have to squeeze everything in less than 32 Kbytes and most of it is already used for controlling camera settings and to allow user interaction with the CTS board.
In the current implementation will be able to detect around 160 components forming up to 20 blobs of the same colour.