If the spheres are not allowed to touch, the solution of the problemstarts by determining which points are background (black) points. To do this,
we pick a black point on the boundary of the image and determine all black
points connected to it using a connected component algorithm(Section 9.5.3).
These connected components are labels with a value different from 1 or 0. The
remaining black points are interior to spheres. We can fill all spheres with
white by applying the hole filling algorithm in Section 9.5.2 until all
interior black points have been turned into white points. The alert student
will realize that if the interior points are already known, they can all be
turned simply into white points thus
fillingthe spheres without having to do region filling as a separate procedure.
请不要用谷歌翻译及有道翻译充数,谢谢!