Sharpening images

We will be implementing an image sharpening technique used by modern graphical editors, such as GIMP and Photoshop. This suggests that we apply the Gaussian smoothing filter to a copy of an image and subtract the smoothed version from the original image (in a weighted way so that the values of a constant area remain constant). 

Let's try to apply sharpening to our image of cats and see the change:

using Images, ImageViewgaussian_smoothing = 1intensity = 1# load an image and apply Gaussian smoothing filterimg = load("sample-images/cats-3061372_640.jpg");imgb = imfilter(img, Kernel.gaussian(gaussian_smoothing));# convert images to Float to perform mathematical operationsimg_array = Float16.(channelview(img));imgb_array 

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.