answered 2017-09-25 20:53:54 -0600
You want the morphology operations. Much faster than connectedComponents.