Added method to keep connected components that intersect with Sobel filter