Sorry guys, unfortunately I can no longer share its code.
Part of my Master Thesis. Frame processing in one loop takes 13ms (tested on computer with Windows XP, 1,78GHz and 256RAM). Any ideas let me know! Next release will recognize when two smaller objects merge creating one bigger and after that split into two smaller ones - this means they are the same object before merging.