Finding closed polygon?

How expensive is the Flood Fill feature in OpenCV? I am thinking of using it after Line Segment Detector has made an image of the lines it has detected in the image