How it works...
The euler() function from the mahotas library was used to compute the Euler number (or characteristics) of the input binary image. By default, it uses 8-connectivity.
The flood_fill() function from the skimage.morphology module was used to perform flood filling on the black hole binary image, starting at a specific seed point (200,400) on the dark region inside the black hole (passed as the second argument to the function); the connected points equal to the seed pixel value (here, 0 or black) are found and then set to new_value (here, 1 or white), which is the third input parameter of the function.
The diameter_closing() function from the skimage.morphology module was used to remove all holes of the black hole image with ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access