Magnitude of Sobel filter result, vector or scalar? I have a question about image gradient magnitude, given an image $I$. The horizontal and vertical derivatives resulting from Sobel filters are defined as:
$$K_x=
        \begin{bmatrix}
        -1 &amp; 0 &amp; 1 \\
        -2 &amp; 0 &amp; 2 \\
        -1 &amp; 0 &amp; 1 \\
        \end{bmatrix}*I;
K_y=
        \begin{bmatrix}
        -1 &amp; -2 &amp; -1 \\
         0 &amp; 0 &amp; 0 \\
         1 &amp; 2 &amp; 1 \\
        \end{bmatrix}*I
$$

where $*$ denotes the convolution operator. The gradient magnitudes can be computed as

$$I_{\delta}=\sqrt{(K_x^2+K_y^2)}$$. 

Now, I want to "invert" the result of $I_{\delta}$, so that maximum magnitude gradient values become zero. Then the "inverting" function $g$ is
$$g(I_{\delta})=\max (I_{\delta}) - I_{\delta}\,.$$

My question is: is $I_{\delta}$ scalar or vector? 
What do you think? If it is possible, could you correct help me.
Pretty much by definition, the magnitude of anything is a scalar value.  Though, since you are working on an image, the result is a 2D array of scalar values.

Given Kx and Ky, it's also possible to work out the directions of the edges, as well as the magnitudes, but that's a whole different bit of maths.