|
|
@ -20,10 +20,10 @@ scale invariant. |
|
|
|
|
|
|
|
|
|
|
|
![image](images/sift_scale_invariant.jpg) |
|
|
|
![image](images/sift_scale_invariant.jpg) |
|
|
|
|
|
|
|
|
|
|
|
So, in 2004, **D.Lowe**, University of British Columbia, came up with a new algorithm, Scale |
|
|
|
In 2004, **D.Lowe**, University of British Columbia, came up with a new algorithm, Scale |
|
|
|
Invariant Feature Transform (SIFT) in his paper, **Distinctive Image Features from Scale-Invariant |
|
|
|
Invariant Feature Transform (SIFT) in his paper, **Distinctive Image Features from Scale-Invariant |
|
|
|
Keypoints**, which extract keypoints and compute its descriptors. *(This paper is easy to understand |
|
|
|
Keypoints**, which extract keypoints and compute its descriptors. *(This paper is easy to understand |
|
|
|
and considered to be best material available on SIFT. So this explanation is just a short summary of |
|
|
|
and considered to be best material available on SIFT. This explanation is just a short summary of |
|
|
|
this paper)*. |
|
|
|
this paper)*. |
|
|
|
|
|
|
|
|
|
|
|
There are mainly four steps involved in SIFT algorithm. We will see them one-by-one. |
|
|
|
There are mainly four steps involved in SIFT algorithm. We will see them one-by-one. |
|
|
@ -102,16 +102,17 @@ reasons. In that case, ratio of closest-distance to second-closest distance is t |
|
|
|
greater than 0.8, they are rejected. It eliminates around 90% of false matches while discards only |
|
|
|
greater than 0.8, they are rejected. It eliminates around 90% of false matches while discards only |
|
|
|
5% correct matches, as per the paper. |
|
|
|
5% correct matches, as per the paper. |
|
|
|
|
|
|
|
|
|
|
|
So this is a summary of SIFT algorithm. For more details and understanding, reading the original |
|
|
|
This is a summary of SIFT algorithm. For more details and understanding, reading the original |
|
|
|
paper is highly recommended. Remember one thing, this algorithm is patented. So this algorithm is |
|
|
|
paper is highly recommended. |
|
|
|
included in [the opencv contrib repo](https://github.com/opencv/opencv_contrib) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SIFT in OpenCV |
|
|
|
SIFT in OpenCV |
|
|
|
-------------- |
|
|
|
-------------- |
|
|
|
|
|
|
|
|
|
|
|
So now let's see SIFT functionalities available in OpenCV. Let's start with keypoint detection and |
|
|
|
Now let's see SIFT functionalities available in OpenCV. Note that these were previously only |
|
|
|
draw them. First we have to construct a SIFT object. We can pass different parameters to it which |
|
|
|
available in [the opencv contrib repo](https://github.com/opencv/opencv_contrib), but the patent |
|
|
|
are optional and they are well explained in docs. |
|
|
|
expired in the year 2020. So they are now included in the main repo. Let's start with keypoint |
|
|
|
|
|
|
|
detection and draw them. First we have to construct a SIFT object. We can pass different |
|
|
|
|
|
|
|
parameters to it which are optional and they are well explained in docs. |
|
|
|
@code{.py} |
|
|
|
@code{.py} |
|
|
|
import numpy as np |
|
|
|
import numpy as np |
|
|
|
import cv2 as cv |
|
|
|
import cv2 as cv |
|
|
|