CTS and connected component labelling


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.

new CTS 1C - color selection

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. 

new CTS 1C - tracking

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.

new CTS 1C - tracking check

In the current implementation will be able to detect around 160 components forming up to 20 blobs of the same colour.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s