Explore Library
Code QuizIntermediate

Gradient Magnitude Computation

Identify why this gradient-magnitude calculation gives wrong values.

Codepython
import numpy as np

def gradient_magnitude(gx, gy):
    # combine x and y gradients into magnitude
    return np.sqrt(gx + gy)

What is the bug in this gradient_magnitude function?