@clockdivider here are some thoughts I had on how to do this with VL.OpenCV, there are likely many ways to go about it but maybe you get some ideas out of this:
To recognize pattern start/end maybe use some pattern like 2 flashes initially in a set amount of time indicating start of pattern (same for all units) and after that, say .5 secs after the pattern begins and this repeats over and over.
I presume with some harsh thresholding you could block everything out except for the super bright areas (LEDs on)
That plus some Erode should give single white blobs which can be tracked with the Blob tracking.
Also CountNonZero after the erode, knowing the expected average pixel size per blob can help you count blinks no?
As for losing tracking of blobs when LEDs are off, you could negate the whole thing and have the LEDs be on all the time and “blink” by turning them off. You could also do something like using an average image of the las few frames for blob tracking (no off states should make a big difference in the average image so you should always be able to track the blob) while using a non-averaged image to count the blinks.
Hope some of that makes sense to you. Good luck!