The approach mentioned in the attached questions.seems robust enough and it should work for most of the cases.
There is no general approach for all images. It can happen that same approach might not give results for some images.
Try on multiple images to determine effectiveness of an approach.
Hope it helps