There's more...

Detect and separate the objects from the following binary image using morphological operations:

Can you also detect the lines that are neither vertical nor horizontal from the binary input image?

Now, do some geospatial image processing: count the number of islands from the following map image (of a mangrove forest in India named Sundarban), and you will get diagram along the lines of the following:

Get Python Image Processing Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.