I have an image with 11x11 pixels and in the center of the image is a square of 5x5 pixels, with the gray level of the background 0 and the gray level of the square is 50. How can I compute the result of the magnitude of edges(intensity of the contour) given by the compass operator for this image taking into account that the image is not noisy? I know that the Sobel operator only considers the two orientations which are 0 and 90 degrees convolution masks as here, but I don't know how to apply the math on paper...
These kernels can then be combined together to find the absolute magnitude of the gradient at each point. The gradient magnitude is given by:

