The cross correlation idea may work well, but you will have to perform it with varying levels of stretching.
The cross correlation will be computed using a 2D window of length L and height H representing the activity. Choose a moderate length L that resembles the expected length of the activity. Assume that in the 'white regions' the function value is a constant that is different from the values representing the activity filled regions. This way your 2D window can have up to 4 different function values representing the r,g,b, and w segments. .
The cross correlation will be taken between the signal and this window for n iterations where in each iteration the enlarging/shrinking factor takes a new value. You probably won't need the three channels.