Merging almost-connected objects

As in the previous activities, we will be using geometrical-figures-and-noise.jpg from the sample-images folder. It has many different connected figures and noise added on both sides, as shown in the following screenshot:

We will start by removing gaps and holes between geometrical objects and comparing when running the dilate function once and three times, by using this code:

using Images, ImageView, ImageMorphologygeom_img = load("sample-images/geometrical-figures-and-noise.jpg");geom_img_binary = Gray.(1 * Gray.(geom_img) .> 0.5);geom_img_binary_d = dilate(geom_img_binary)imshow(geom_img_binary_d)geom_img_binary_d ...

Get Hands-On Computer Vision with Julia 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.