Highlighting details

Now we will try to apply the dilate function to an image with the number plate. If the erode function has been separating the number plate letters and digits, then dilate will extend the borders of every object. We will use the following code to implement this:

using Images, ImageView, ImageMorphologycarplate_img = load("sample-images/caribbean-2726429_640.jpg")carplate_img_binary = Gray.(Gray.(carplate_img) .< 0.5)carplate_img_binary_d = dilate(carplate_img_binary)imshow(carplate_img_binary_d)

If you repeat code and zoom in the result, you will see that the borders of the map behind the digits are taking more space:

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.