User:Omkar.p.rao/sandbox

Frei-Chen Operator
The Frei-Chen edge detector is a technique for identifying edges in digital images in areas like image processing and computer vision. Like the Sobel operator, it aims to locate points where the intensity changes sharply. However, the Frei-Chen operator provides slightly better edge detection performance and can detect corners along side edges. It consists of nine 3x3 kernels, each used to detect edges and lines, or for computing average.

Formulation
The operator used nine 3x3 kernels called the Frei Chen mask set, which are convolved with the original image to obtain first-order derivatives. The first four masks represent the edge subspace, where $$G_1$$ and $$G_2$$ represent Isotropic Average Gradient, $$G_3$$ and $$G_4$$ represent the Ripple Gradient. The next 4 masks represent the line subspace, where $$G_5$$ and $$G_6$$ represent lines with directional preference, $$G_7$$ and $$G_8$$ represent lines without directional preference. The last mask $$G_9$$ is used for computing the average.

$$\begin{aligned} \mathbf{G}_1 &= \frac{1}{2\sqrt{2}}\begin{bmatrix} +1 & +\sqrt{2} & +1 \\ 0 & 0 & 0 \\ -1 & -\sqrt{2} & -1 \end{bmatrix} * \mathbf{A} \\ \mathbf{G}_2 &= \frac{1}{2\sqrt{2}}\begin{bmatrix} +1 & 0 & -1 \\ +\sqrt{2} & 0 & -\sqrt{2} \\ +1 & 0 & -1 \end{bmatrix} * \mathbf{A} \\ \mathbf{G}_3 &= \frac{1}{2\sqrt{2}}\begin{bmatrix} 0 & -1 &+\sqrt{2} \\ +1 & 0 & -1\\ -\sqrt{2} & -1 & 0 \end{bmatrix} * \mathbf{A} \\ \mathbf{G}_4 &= \frac{1}{2\sqrt{2}}\begin{bmatrix} +\sqrt{2} & -1 & 0 \\ -1 & 0 & +1 \\ 0 & +1 &-\sqrt{2} \end{bmatrix} * \mathbf{A} \\ \mathbf{G}_5 &= \frac{1}{2}\begin{bmatrix} 0 & +1 & 0 \\ -1 & 0 & -1 \\ 0 & +1 & 0 \end{bmatrix} * \mathbf{A} \\ \mathbf{G}_6 &= \frac{1}{2}\begin{bmatrix} -1 & 0 & +1 \\ 0 & 0 & 0\\ +1 & 0 & -1 \end{bmatrix} * \mathbf{A} \\ \mathbf{G}_7 &= \frac{1}{6}\begin{bmatrix} +1 & -2 & +1 \\ -2 & +4 & -2 \\ +1 & -2 & +1 \end{bmatrix} * \mathbf{A} \\ \mathbf{G}_8 &= \frac{1}{6}\begin{bmatrix} -2 & +1 & -2 \\ +1 & +4 & +1 \\ -2 & +1 & -2 \end{bmatrix} * \mathbf{A} \\ \mathbf{G}_9 &= \frac{1}{3}\begin{bmatrix} +1 & +1 & +1 \\ +1 & +1 & +1   \\ +1 & +1 & +1  \end{bmatrix} * \mathbf{A} \\ \end{aligned}$$

Here A denotes the original image and $$*$$ represents the 2-dimensional Convolution operation.

It is imperative to note here that not all masks need to be used while performing convolution. We can reduce the dimensions of the features subspace by dropping those features that do not contribute much to the subspace. This gives us an acceptable output with reduced computation.