user1235183
user1235183

Reputation: 3072

Which algorithm is implemented in cv::floodfill

Which algorithm is implemented in cv::floodfill? Does anyone know the paper or an other reference?

Upvotes: 1

Views: 422

Answers (1)

Michael Laszlo
Michael Laszlo

Reputation: 12239

The algorithm employed to mark a region of similar pixels is called flood fill, hence the name of the OpenCV method. Flood fill can be implemented recursively or iteratively. The iterative approach can push pixel coordinates into a queue or onto a stack. The order of exploration doesn't matter because in all cases you end up visiting every pixel that is connected to the starting pixel. The important thing is to mark the pixels that you have visited so that you don't explore them again.

Upvotes: 1

Related Questions