Edge detection kernel

Produces a value close to zero when all pixels are similar and a non-zero value if there is a drastic change of values in the pixel and its neighbours

This detects scenarios where the Homophily property does not hold, hence detecting an edge.

Edge detection is performed using the 3×3 Prewitt horizontal kernel to highlight the horizontal edges in the image.

K=(111000111)
# Trying one kernel (Prewitt kernel for horizontal edges)
kernel1 = np.array([[1, 1, 1],[0, 0, 0],[-1, -1, -1]])
image_conv1 = convolution(im_array, kernel1)
print(image_conv1.shape)