Separating touching objects in binary image

I suspect that only AI can solve that satisfactorily… or you impose some changes on the mechanical side so these boards get some separation

that grayscale image looks separable but comparing the two mask pictures, the source of the first mask must be two boards with a very faint gap between them.