necessity of patch size in edge detection algorithms I have recently started learning about the image edge detection methods. I studied few of these methods including Sobel and Canny. I observed that edge detection is performed using patch/kernel size as 3x3. 

My question is, Is it necessary to fix the patch size as 3x3? OR can we take it as 5x5, 7x7, 9x9 etc.

I have already studied few technical papers that says that patch size is taken as low as possible in order to make computational complexity as low as possible
Let's start to given some information.

We now that the sobel operator perform a aproximmation of the image gradient using convolution ( $ * $ ).

Then,

Being $\mathbf{A}$ an image of $n \times m$ size.

The operator $\mathbf{K}$, commonly, uses two $3 \times 3$ kernels which are convolved with the original image. Thus we have

$\mathbf{G_x} = \mathbf{K_x} * \mathbf{A} $

$\mathbf{G_y} = \mathbf{K_y} * \mathbf{A} $

Being 
$$
  \mathbf{K_x} =  
  \left[ {\begin{array}{cc}
                -1 &amp; 0 &amp; +1\\  
                -2 &amp; 0 &amp; +2\\  
                -1 &amp; 0 &amp; +1\\  
              \end{array} } \right]
$$

And,

$$
  \mathbf{K_y} =  
  \left[ {\begin{array}{cc}
                -1 &amp; -2 &amp; -1\\  
                 0 &amp; 0 &amp; 0\\  
                +1 &amp; +2 &amp; +1\\  
              \end{array} } \right]
$$

So, an extension of this kernel is a $5 \times 5$ matrix 

$$
  \mathbf{K_y} =  
  \left[ {\begin{array}{cc}
                -1 &amp; -4 &amp; -6  &amp; -4 &amp; -1\\  
                -2 &amp; -8 &amp; -12 &amp; -8 &amp; -2\\  
                 0 &amp;  0 &amp;  0  &amp;  0 &amp;  0\\
                +2 &amp; +8 &amp; +12 &amp;  8 &amp;  2\\ 
                +1 &amp; +4 &amp; +6  &amp; +4 &amp; +1\\ 
              \end{array} } \right]
$$

$$
  \mathbf{K_x} =  
  \left[ {\begin{array}{cc}
                 +1 &amp;  +2  &amp; 0 &amp; -2  &amp; -1\\  
                 +4 &amp;  +8  &amp; 0 &amp; -8  &amp; -4\\  
                 +6 &amp;  +12 &amp; 0 &amp; -12 &amp; -6\\
                 +4 &amp;  +8  &amp; 0 &amp; -8  &amp; -4\\ 
                 +1 &amp;  +2  &amp; 0 &amp; -2  &amp; -1\\ 
              \end{array} } \right]
$$

This article demonstrates how to get Sobel gradient operators analytically. For that was using linear approximation of brightness in window 3x3.  Every pixel in window has its own weight. Special weight matrix selection gives Sobel gradient operator.