I know it's a very late answer .. but in order to separate the shadows from objects, I do this (using Photoshop):
layer with beauty:
RGBA ..and as mask >>> shadow.mask (inverted)
layer with shadows:
SHADOW.RGB ..and as mask >>> shadow.diff (set transparency on "multiply")
It works very well, also with foreground transparent object (like glass) covering the shadows on the ground 🙂 I use it for many renders showing metal machinery on white infinite backgrounds.