HomologousPointsExtraction : SURF is much slower than SIFT

Hello,

Context

I’m using the application Homologous Points Extraction to perform the co-registration between two ortho-images from Sentinel-2 :

  • Both images have a size of 512x512 pixels
  • I use the band 4 of the images to extract homologous points
  • One image has been intentionally padded so that this one is is poorly georeferenced, the other image is the reference image.

Configuration setup

My system: Ubuntu 18.04.5 LTS
Version of the OTB: 7-2.0
I installed the OTB with: the binaries
Python version: 3.7.9

Description of my issue

I found that the use of SURF algorithm makes the process much slower than using the SIFT algorithm. Indeed, the process takes 38s when using SURF while it only takes 1s when using SIFT.

Logs of each process
Using SURF
2021-05-11 13:44:53 (INFO) HomologousPointsExtraction: Default RAM limit for OTB is 256 MB
2021-05-11 13:44:53 (INFO) HomologousPointsExtraction: GDAL maximum cache size is 1604 MB
2021-05-11 13:44:53 (INFO) HomologousPointsExtraction: OTB will use at most 8 threads
2021-05-11 13:44:53 (INFO) HomologousPointsExtraction: Elevation management: setting default height above ellipsoid to 0 meters
2021-05-11 13:44:53 (INFO) HomologousPointsExtraction: Doing update
2021-05-11 13:44:58 (INFO) HomologousPointsExtraction: Found 41646 surf points in image 1.
2021-05-11 13:45:02 (INFO) HomologousPointsExtraction: Found 41210 surf points in image 2.
2021-05-11 13:46:31 (INFO) HomologousPointsExtraction: Found 89 homologous points.
2021-05-11 13:46:31 (INFO) HomologousPointsExtraction: 0 points discarded

Using SIFT
2021-05-11 14:32:53 (INFO) HomologousPointsExtraction: Default RAM limit for OTB is 256 MB
2021-05-11 14:32:53 (INFO) HomologousPointsExtraction: GDAL maximum cache size is 1604 MB
2021-05-11 14:32:53 (INFO) HomologousPointsExtraction: OTB will use at most 8 threads
2021-05-11 14:32:53 (INFO) HomologousPointsExtraction: Elevation management: setting default height above ellipsoid to 0 meters
2021-05-11 14:32:53 (INFO) HomologousPointsExtraction: Using SIFT points
2021-05-11 14:32:54 (INFO) HomologousPointsExtraction: Found 2511 sift points in image 1.
2021-05-11 14:32:54 (INFO) HomologousPointsExtraction: Found 2445 sift points in image 2.
2021-05-11 14:32:54 (INFO) HomologousPointsExtraction: Found 1659 homologous points.
2021-05-11 14:32:54 (INFO) HomologousPointsExtraction: 0 points discarded

Parameters used for the application :
./otbcli_HomologousPointsExtraction
-in1 T37SDU_20200825T080609_B04_10m_pad20_crop.jp2
-in2 T37SDU_20200914T080609_B04_10m_crop.jp2
-algorithm surf
-mode full
-threshold 0.2
-backmatching 0
-mfilter 0
-outvector points.shp
-out hom_points.txt \

Do you know the reason of this difference ? I think that it comes from the fact that SURF extracts much more points on the images than using SIFT :

  • 41646 and 41210 points using SURF
  • 2511 and 2445 points using SIFT

However I found that the threshold 0.2 given in input is used during the matching phase, not the extraction phase so I found no way to decrease the number of points extracted by SURF. Also note that using the SURF algorithm on the same images in OpenCV (OpenCV: Introduction to SURF (Speeded-Up Robust Features)) only extract 3524 and 3469 points and takes 1s to execute.

Thank you very much for your help !

Adrien Lauwers.

Hello @adrien_lauwers ,

The matching algorithm is a bit (too?) simplist in HomologousPointsExtraction, and works in a kind of “brute force” fashion: for each feature vector, is searched the closest (in the feature space), which makes this o(n2).
That is why it takes so long with 40k points >> 2k points.

That is also why the HomologousPointsExtraction will work faster with mode set to geobins.

Hope that helps!

Regards

Hello @remi.cresson ,

You are right the matching algorithm is long as it has to treat the 80k points found by SURF.

But I don’t think it is expected that SURF finds so many points, compared to SIFT and also compared to the SURF implementation from OpenCV. What is your opinion on this?

Regards

Adrien Lauwers

Hello @adrien_lauwers , I don’t know. I am not familiar with SIFT and SURF, sorry!

Thanks for the help @remi.cresson

Does anyone have a solution for this problem? The test was done on several images and the problem occurs on each of the tests. However SURF is supposed to be faster than SIFT…

As the problem does not occur in the OpenCV, could this be a bug from OTB in the SURF implementation ?

Thank you for your help !

Adrien Lauwers.