Then comes the main part. After this, they created a score, basically an equation, which
determines if a window can contain a corner or not.
-\f[R = det(M) - k(trace(M))^2\f]
+\f[R = \det(M) - k(\operatorname{trace}(M))^2\f]
where
- - \f$det(M) = \lambda_1 \lambda_2\f$
- - \f$trace(M) = \lambda_1 + \lambda_2\f$
- - \f$\lambda_1\f$ and \f$\lambda_2\f$ are the eigenvalues of M
+ - \f$\det(M) = \lambda_1 \lambda_2\f$
+ - \f$\operatorname{trace}(M) = \lambda_1 + \lambda_2\f$
+ - \f$\lambda_1\f$ and \f$\lambda_2\f$ are the eigenvalues of \f$M\f$
So the magnitudes of these eigenvalues decide whether a region is a corner, an edge, or flat.
Instead of this, Shi-Tomasi proposed:
-\f[R = min(\lambda_1, \lambda_2)\f]
+\f[R = \min(\lambda_1, \lambda_2)\f]
If it is a greater than a threshold value, it is considered as a corner. If we plot it in
\f$\lambda_1 - \lambda_2\f$ space as we did in Harris Corner Detector, we get an image as below:

From the figure, you can see that only when \f$\lambda_1\f$ and \f$\lambda_2\f$ are above a minimum value,
-\f$\lambda_{min}\f$, it is considered as a corner(green region).
+\f$\lambda_{\min}\f$, it is considered as a corner(green region).
Code
----
kp, des = sift.detectAndCompute(gray,None)
@endcode
Here kp will be a list of keypoints and des is a numpy array of shape
-\f$Number\_of\_Keypoints \times 128\f$.
+\f$\text{(Number of Keypoints)} \times 128\f$.
So we got keypoints, descriptors etc. Now we want to see how to match keypoints in different images.
That we will learn in coming chapters.