Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Task01 Дмитрий Чучин ITMO #5

Closed

Conversation

capitanFlint129
Copy link

@capitanFlint129 capitanFlint129 commented Feb 25, 2024

Перечислите идеи и коротко обозначьте мысли которые у вас возникали по мере выполнения задания, в частности попробуйте ответить на вопросы:

  1. Почему SIFT менее точно угадывает средний угол отклонения? изменяется ли ситуация если выкрутить параметр ORIENTATION_VOTES_PEAK_RATIO=0.999? почему?

Потому что мы ограничены тем как именно мы считаем угол в данном алгоритме. Мы приравниваем все углы в бине и даже с учетом приближения параболой угол нельзя посчитать точно. Так, увеличение ORIENTATION_NHISTS до 72 улучшило качество определения угла во всех преобразованиях с поворотом (не всегда значительно, но местами до 10 градусов). При этом ORIENTATION_VOTES_PEAK_RATIO=0.999 уменьшит количество детектируемых ключевых точек, при этом не повлияет на точность определения угла.

  1. Как надежно замерить во сколько раз распараллеливание через OpenMP ускоряет ваш вариант SIFT? Попробуйте сделать это на вашем компьютере, какое ускорение относительно однопоточной версии оказалось? Сколько у вашего процессора ядер и сколько потоков?

4 ядра, по 2 потока. Точный замер можно было бы сделать запустив много раз каждый тест в однопоточном и многопоточном варианте замерив время, затем усреднить по тесту и сравнить на картинках с разным размером и количеством ключевых точек. Однако я не успел провести хорошее сравнение. При проверке с помощью утилиты time однопоточный код локально работал примерно 9 минут, а многопоточный - 5.

  1. Правда ли можно строить каждый слой в Gaussian пирамиде из самого первого слоя этой октавы? Или нужно обязательно делать так как предложено в статье - дополняя размытие предыдущего слоя этой октавы? Совпадают ли пирамиды визуально?

Нет, не обязательно, поскольку, как приведено в коде, есть явная формула для вычисления сигмы для размытия уже частично размытого изображения до нужного значения сигмы. Визуально пирамиды совпали

  1. Какие ожидания от картинок в Gaussian пирамиде можно придумать? Как проверить что работает корректно? С какой другой картинкой предыдущей октавы должна визуально совпадать конкретная картинка конкретной октавы? Как их визуально сравнить, ведь они разного размера?

Возможно с картинкой, имеющей ту же дисперсию при фактическом применении cv::GaussianBlur. Для такого сравнения можно было бы оценить увеличение сигмы от даунскейла и размыть дополнительно большую картинку соответствующим ядром, а затем сделать уменьшение с INTER_NEAREST. (попробовать не успел)

  1. Почему в октаве Gaussian пирамиды s+3 картинки а не s+2 например?

Поскольку один слой при переходе к DoG теряется

  1. Какие ожидания от картинок в DoG пирамиде можно придумать?

Не знаю. Кажется у всех слоев должны быть разные дисперсии и как следствие разные пятна показывающие ключевые объекты. Разве не в этом вся суть DoG? Почему они вообще должны быть похожи у разных слоев?

  1. Почему порог контрастности должен уменьшаться при увеличении числа слоев в октаве?

Потому что в этом случае у нас уменьшается шаг между дисперсиями слоев, из-за этого ядра становятся более похожи друг на друга и отклик станет меньше.

  1. Какая строка ответственна за определение сигмы (или что почти то же самое - радиуса) которая задает окрестность по которой определяется ориентация ключевой точки?

Строчка 281: int oriRadius = (int) (ORIENTATION_WINDOW_R * (1.0 + k * (layer - 1)));

  1. За какой строки вашего кода дескриптор инвариантен к повороту картинки?

Строчка 409: orientation = (orientation + 90.0 + angle);
(догадался если честно не сам)

Github Actions CI

Run ./build/test_sift
Running main() from /home/runner/work/PhotogrammetryTasks2024/PhotogrammetryTasks2024/libs/3rdparty/libgtest/googletest/src/gtest_main.cc
[==========] Running 22 tests from 1 test suite.
[----------] Global test environment set-up.
[----------] 22 tests from SIFT
[ RUN      ] SIFT.MovedTheSameImage
[ORB_OCV] Points detected: 500 -> 500 (in 0.01557 sec)
[ORB_OCV] 493/500 (recall=0.98[6](https://github.com/PhotogrammetryCourse/PhotogrammetryTasks2024/actions/runs/8040524241/job/21958719078?pr=5#step:7:7)) with average error=0.0520289
[ORB_OCV] average size ratio between matched points: 1.00185
[ORB_OCV] average angle difference between matched points: 0.145135 degrees
[ORB_OCV] average descriptor distance between matched points: 8.80[7](https://github.com/PhotogrammetryCourse/PhotogrammetryTasks2024/actions/runs/8040524241/job/21958719078?pr=5#step:7:8)3 (random distance: 127.325) => differentiability=0.0691721

[SIFTOCV] Points detected: 453 -> 465 (in 0.094066 sec)
[SIFTOCV] 436/453 (recall=0.962472) with average error=0.04356[8](https://github.com/PhotogrammetryCourse/PhotogrammetryTasks2024/actions/runs/8040524241/job/21958719078?pr=5#step:7:9)6
[SIFTOCV] average size ratio between matched points: 0.[9](https://github.com/PhotogrammetryCourse/PhotogrammetryTasks2024/actions/runs/8040524241/job/21958719078?pr=5#step:7:10)98252
[SIFTOCV] average angle difference between matched points: -4.7478 degrees
[SIFTOCV] average descriptor distance between matched points: 90.3355 (random distance: 523.008) => differentiability=0.172723

[SIFT_MY] Points detected: 1917 -> 1938 (in 2.61603 sec)
[SIFT_MY] 1891/1917 (recall=0.986437) with average error=0.139349
[SIFT_MY] average size ratio between matched points: 1.00072
[SIFT_MY] average angle difference between matched points: -6.33[10](https://github.com/PhotogrammetryCourse/PhotogrammetryTasks2024/actions/runs/8040524241/job/21958719078?pr=5#step:7:11)1 degrees
[SIFT_MY] average descriptor distance between matched points: 0.469537 (random distance: 1.28284) => differentiability=0.366015

[       OK ] SIFT.MovedTheSameImage (2863 ms)
[ RUN      ] SIFT.MovedImageRight
[ORB_OCV] Points detected: 500 -> 500 (in 0.014104 sec)
[ORB_OCV] 471/500 (recall=0.942) with average error=0.502929
[ORB_OCV] average size ratio between matched points: 0.992385
[ORB_OCV] average angle difference between matched points: -0.67963 degrees
[ORB_OCV] average descriptor distance between matched points: 31.7219 (random distance: 127.724) => differentiability=0.248363

[SIFTOCV] Points detected: 453 -> 447 (in 0.0917[11](https://github.com/PhotogrammetryCourse/PhotogrammetryTasks2024/actions/runs/8040524241/job/21958719078?pr=5#step:7:12) sec)
[SIFTOCV] 421/442 (recall=0.952489) with average error=0.107924
[SIFTOCV] average size ratio between matched points: 1.01134
[SIFTOCV] average angle difference between matched points: -3.58242 degrees
[SIFTOCV] average descriptor distance between matched points: 90.1555 (random distance: 527.86) => differentiability=0.170794

[SIFT_MY] Points detected: 1917 -> 1852 (in 2.62716 sec)
[SIFT_MY] 1800/1838 (recall=0.979325) with average error=0.132573
[SIFT_MY] average size ratio between matched points: 0.997486
[SIFT_MY] average angle difference between matched points: -7.16876 degrees
[SIFT_MY] average descriptor distance between matched points: 0.468109 (random distance: 1.28377) => differentiability=0.364636

[       OK ] SIFT.MovedImageRight (2821 ms)
[ RUN      ] SIFT.MovedImageLeft
[ORB_OCV] Points detected: 500 -> 500 (in 0.015068 sec)
[ORB_OCV] 466/498 (recall=0.935743) with average error=0.485198
[ORB_OCV] average size ratio between matched points: 1.0061
[ORB_OCV] average angle difference between matched points: -2.01597 degrees
[ORB_OCV] average descriptor distance between matched points: 30.279 (random distance: [12](https://github.com/PhotogrammetryCourse/PhotogrammetryTasks2024/actions/runs/8040524241/job/21958719078?pr=5#step:7:13)6.457) => differentiability=0.239441

[SIFTOCV] Points detected: 453 -> 447 (in 0.085838 sec)
[SIFTOCV] 417/441 (recall=0.945578) with average error=0.0855277
[SIFTOCV] average size ratio between matched points: 0.997577
[SIFTOCV] average angle difference between matched points: -6.43682 degrees
[SIFTOCV] average descriptor distance between matched points: 97.5722 (random distance: 523.97) => differentiability=0.186217

[SIFT_MY] Points detected: 1917 -> 1816 (in 2.68201 sec)
[SIFT_MY] 1751/1811 (recall=0.966869) with average error=0.1558[13](https://github.com/PhotogrammetryCourse/PhotogrammetryTasks2024/actions/runs/8040524241/job/21958719078?pr=5#step:7:14)
[SIFT_MY] average size ratio between matched points: 0.999079
[SIFT_MY] average angle difference between matched points: -6.53976 degrees
[SIFT_MY] average descriptor distance between matched points: 0.476799 (random distance: 1.27885) => differentiability=0.372834

[       OK ] SIFT.MovedImageLeft (2868 ms)
[ RUN      ] SIFT.MovedImageUpHalfPixel
[ORB_OCV] Points detected: 500 -> 500 (in 0.013968 sec)
[ORB_OCV] 460/497 (recall=0.925553) with average error=0.710802
[ORB_OCV] average size ratio between matched points: 1.01167
[ORB_OCV] average angle difference between matched points: 0.857323 degrees
[ORB_OCV] average descriptor distance between matched points: 42.9087 (random distance: 123.602) => differentiability=0.347152

[SIFTOCV] Points detected: 453 -> 504 (in 0.090536 sec)
[SIFTOCV] 369/445 (recall=0.829213) with average error=0.396924
[SIFTOCV] average size ratio between matched points: 1.04453
[SIFTOCV] average angle difference between matched points: -3.55702 degrees
[SIFTOCV] average descriptor distance between matched points: 153.011 (random distance: 526.21) => differentiability=0.290779

[SIFT_MY] Points detected: 1917 -> 1604 (in 2.66212 sec)
[SIFT_MY] 1622/1809 (recall=0.896628) with average error=0.911955
[SIFT_MY] average size ratio between matched points: 1.0187
[SIFT_MY] average angle difference between matched points: -4.2223 degrees
[SIFT_MY] average descriptor distance between matched points: 0.776952 (random distance: 1.28183) => differentiability=0.606129

[       OK ] SIFT.MovedImageUpHalfPixel (2850 ms)
[ RUN      ] SIFT.MovedImageDownHalfPixel
[ORB_OCV] Points detected: 500 -> 500 (in 0.0[14](https://github.com/PhotogrammetryCourse/PhotogrammetryTasks2024/actions/runs/8040524241/job/21958719078?pr=5#step:7:15)002 sec)
[ORB_OCV] 442/478 (recall=0.924686) with average error=0.648609
[ORB_OCV] average size ratio between matched points: 0.971097
[ORB_OCV] average angle difference between matched points: -1.00358 degrees
[ORB_OCV] average descriptor distance between matched points: 42.586 (random distance: 125.477) => differentiability=0.339392

[SIFTOCV] Points detected: 453 -> 505 (in 0.087411 sec)
[SIFTOCV] 377/439 (recall=0.85877) with average error=0.44313
[SIFTOCV] average size ratio between matched points: 1.04998
[SIFTOCV] average angle difference between matched points: -4.70645 degrees
[SIFTOCV] average descriptor distance between matched points: 166.33 (random distance: 523.378) => differentiability=0.3178

[SIFT_MY] Points detected: 1917 -> 1665 (in 2.60952 sec)
[SIFT_MY] 1650/1854 (recall=0.889968) with average error=0.913756
[SIFT_MY] average size ratio between matched points: 1.01881
[SIFT_MY] average angle difference between matched points: -4.75241 degrees
[SIFT_MY] average descriptor distance between matched points: 0.768068 (random distance: 1.27689) => differentiability=0.60[15](https://github.com/PhotogrammetryCourse/PhotogrammetryTasks2024/actions/runs/8040524241/job/21958719078?pr=5#step:7:16)14

[       OK ] SIFT.MovedImageDownHalfPixel (2794 ms)
[ RUN      ] SIFT.Rotate10
[ORB_OCV] Points detected: 500 -> 500 (in 0.014139 sec)
[ORB_OCV] 475/500 (recall=0.95) with average error=0.932881
[ORB_OCV] average size ratio between matched points: 1.00527
[ORB_OCV] average angle difference between matched points: 8.46336 degrees
[ORB_OCV] average descriptor distance between matched points: 56.6295 (random distance: 122.783) => differentiability=0.461215

[SIFTOCV] Points detected: 453 -> 533 (in 0.087307 sec)
[SIFTOCV] 369/451 (recall=0.818182) with average error=0.472593
[SIFTOCV] average size ratio between matched points: 1.04212
[SIFTOCV] average angle difference between matched points: -1.87952 degrees
[SIFTOCV] average descriptor distance between matched points: 176.196 (random distance: 521.969) => differentiability=0.337561

[SIFT_MY] Points detected: 1917 -> [16](https://github.com/PhotogrammetryCourse/PhotogrammetryTasks2024/actions/runs/8040524241/job/21958719078?pr=5#step:7:17)47 (in 2.59288 sec)
[SIFT_MY] 1602/1832 (recall=0.874454) with average error=0.937956
[SIFT_MY] average size ratio between matched points: 1.02773
[SIFT_MY] average angle difference between matched points: 1.88202 degrees
[SIFT_MY] average descriptor distance between matched points: 0.993441 (random distance: 1.27939) => differentiability=0.776496

[       OK ] SIFT.Rotate10 (2778 ms)
[ RUN      ] SIFT.Rotate20
[ORB_OCV] Points detected: 500 -> 500 (in 0.01413 sec)
[ORB_OCV] 456/491 (recall=0.9287[17](https://github.com/PhotogrammetryCourse/PhotogrammetryTasks2024/actions/runs/8040524241/job/21958719078?pr=5#step:7:18)) with average error=0.860867
[ORB_OCV] average size ratio between matched points: 0.968872
[ORB_OCV] average angle difference between matched points: 19.4252 degrees
[ORB_OCV] average descriptor distance between matched points: 58.3224 (random distance: 125.59) => differentiability=0.464387

[SIFTOCV] Points detected: 453 -> 537 (in 0.086815 sec)
[SIFTOCV] 355/443 (recall=0.801354) with average error=0.507026
[SIFTOCV] average size ratio between matched points: 1.06094
[SIFTOCV] average angle difference between matched points: -0.883312 degrees
[SIFTOCV] average descriptor distance between matched points: [18](https://github.com/PhotogrammetryCourse/PhotogrammetryTasks2024/actions/runs/8040524241/job/21958719078?pr=5#step:7:19)0.204 (random distance: 526.309) => differentiability=0.342392

[SIFT_MY] Points detected: [19](https://github.com/PhotogrammetryCourse/PhotogrammetryTasks2024/actions/runs/8040524241/job/21958719078?pr=5#step:7:20)17 -> 1610 (in 2.8572 sec)
[SIFT_MY] 1559/1772 (recall=0.879797) with average error=0.999953
[SIFT_MY] average size ratio between matched points: 1.02426
[SIFT_MY] average angle difference between matched points: 5.5531 degrees
[SIFT_MY] average descriptor distance between matched points: 1.[20](https://github.com/PhotogrammetryCourse/PhotogrammetryTasks2024/actions/runs/8040524241/job/21958719078?pr=5#step:7:21)078 (random distance: 1.28544) => differentiability=0.934139

[       OK ] SIFT.Rotate20 (3045 ms)
[ RUN      ] SIFT.Rotate30
[ORB_OCV] Points detected: 500 -> 500 (in 0.01406 sec)
[ORB_OCV] 446/479 (recall=0.931106) with average error=0.954674
[ORB_OCV] average size ratio between matched points: 0.971588
[ORB_OCV] average angle difference between matched points: 25.313 degrees
[ORB_OCV] average descriptor distance between matched points: 56.7668 (random distance: 125.177) => differentiability=0.453492

[SIFTOCV] Points detected: 453 -> 511 (in 0.086962 sec)
[SIFTOCV] 361/441 (recall=0.818594) with average error=0.629674
[SIFTOCV] average size ratio between matched points: 1.05297
[SIFTOCV] average angle difference between matched points: 4.7407 degrees
[SIFTOCV] average descriptor distance between matched points: 195.638 (random distance: 526.907) => differentiability=0.371295

[SIFT_MY] Points detected: 1917 -> 1456 (in 2.67559 sec)
[SIFT_MY] 1501/1741 (recall=0.86[21](https://github.com/PhotogrammetryCourse/PhotogrammetryTasks2024/actions/runs/8040524241/job/21958719078?pr=5#step:7:22)48) with average error=1.09235
[SIFT_MY] average size ratio between matched points: 1.03135
[SIFT_MY] average angle difference between matched points: 17.5349 degrees
[SIFT_MY] average descriptor distance between matched points: 1.27494 (random distance: 1.27743) => differentiability=0.998055

[       OK ] SIFT.Rotate30 (2861 ms)
[ RUN      ] SIFT.Rotate40
[ORB_OCV] Points detected: 500 -> 500 (in 0.014011 sec)
[ORB_OCV] 445/475 (recall=0.936842) with average error=0.927974
[ORB_OCV] average size ratio between matched points: 0.992927
[ORB_OCV] average angle difference between matched points: 35.1473 degrees
[ORB_OCV] average descriptor distance between matched points: 57.0315 (random distance: 125.292) => differentiability=0.455188

[SIFTOCV] Points detected: 453 -> 470 (in 0.08724 sec)
[SIFTOCV] 335/436 (recall=0.768349) with average error=0.7[22](https://github.com/PhotogrammetryCourse/PhotogrammetryTasks2024/actions/runs/8040524241/job/21958719078?pr=5#step:7:23)947
[SIFTOCV] average size ratio between matched points: 1.07134
[SIFTOCV] average angle difference between matched points: 12.1292 degrees
[SIFTOCV] average descriptor distance between matched points: 189.937 (random distance: 524.78) => differentiability=0.361937

[SIFT_MY] Points detected: 1917 -> 1522 (in 2.80386 sec)
[SIFT_MY] 1504/1707 (recall=0.881078) with average error=1.19598
[SIFT_MY] average size ratio between matched points: 1.0308
[SIFT_MY] average angle difference between matched points: 21.8881 degrees
[SIFT_MY] average descriptor distance between matched points: 1.30201 (random distance: 1.27902) => differentiability=1.01798

[       OK ] SIFT.Rotate40 (2989 ms)
[ RUN      ] SIFT.Rotate45
[ORB_OCV] Points detected: 500 -> 500 (in 0.014083 sec)
[ORB_OCV] 427/475 (recall=0.898947) with average error=0.913293
[ORB_OCV] average size ratio between matched points: 0.999695
[ORB_OCV] average angle difference between matched points: 40.7936 degrees
[ORB_OCV] average descriptor distance between matched points: 57.0351 (random distance: 126.834) => differentiability=0.449684

[SIFTOCV] Points detected: 453 -> 5[23](https://github.com/PhotogrammetryCourse/PhotogrammetryTasks2024/actions/runs/8040524241/job/21958719078?pr=5#step:7:24) (in 0.086785 sec)
[SIFTOCV] 354/431 (recall=0.821346) with average error=0.708972
[SIFTOCV] average size ratio between matched points: 1.0578
[SIFTOCV] average angle difference between matched points: 21.2252 degrees
[SIFTOCV] average descriptor distance between matched points: 193.048 (random distance: 528.943) => differentiability=0.364969

[SIFT_MY] Points detected: 1917 -> 1577 (in 2.89271 sec)
[SIFT_MY] 1469/1704 (recall=0.862089) with average error=1.17509
[SIFT_MY] average size ratio between matched points: 1.0229
[SIFT_MY] average angle difference between matched points: 31.1962 degrees
[SIFT_MY] average descriptor distance between matched points: 1.30695 (random distance: 1.2774) => differentiability=1.02313

[       OK ] SIFT.Rotate45 (3080 ms)
[ RUN      ] SIFT.Rotate90
[ORB_OCV] Points detected: 500 -> 500 (in 0.014012 sec)
[ORB_OCV] 406/475 (recall=0.854737) with average error=0.794018
[ORB_OCV] average size ratio between matched points: 0.926186
[ORB_OCV] average angle difference between matched points: 81.2045 degrees
[ORB_OCV] average descriptor distance between matched points: 52.2069 (random distance: 126.239) => differentiability=0.413556

[SIFTOCV] Points detected: 453 -> 429 (in 0.085185 sec)
[SIFTOCV] 397/428 (recall=0.92757) with average error=0.597669
[SIFTOCV] average size ratio between matched points: 0.994223
[SIFTOCV] average angle difference between matched points: 68.2509 degrees
[SIFTOCV] average descriptor distance between matched points: 109.39 (random distance: 522.253) => differentiability=0.209459

[SIFT_MY] Points detected: 1917 -> 1794 (in 3.05435 sec)
[SIFT_MY] 1608/1738 (recall=0.925201) with average error=1.15[24](https://github.com/PhotogrammetryCourse/PhotogrammetryTasks2024/actions/runs/8040524241/job/21958719078?pr=5#step:7:25)6
[SIFT_MY] average size ratio between matched points: 1.00046
[SIFT_MY] average angle difference between matched points: 67.7202 degrees
[SIFT_MY] average descriptor distance between matched points: 1.29134 (random distance: 1.2816) => differentiability=1.0076

[       OK ] SIFT.Rotate90 (3240 ms)
[ RUN      ] SIFT.Scale50
[ORB_OCV] Points detected: 500 -> 500 (in 0.013513 sec)
[ORB_OCV] 463/500 (recall=0.926) with average error=0.927987
[ORB_OCV] average size ratio between matched points: 0.829127
[ORB_OCV] average angle difference between matched points: 2.9143 degrees
[ORB_OCV] average descriptor distance between matched points: 89.7322 (random distance: 124.84) => differentiability=0.718776

[SIFTOCV] Points detected: 453 -> 191 (in 0.082216 sec)
[SIFTOCV] 235/453 (recall=0.518764) with average error=1.81213
[SIFTOCV] average size ratio between matched points: 0.90594
[SIFTOCV] average angle difference between matched points: -0.218442 degrees
[SIFTOCV] average descriptor distance between matched points: 362.817 (random distance: 526.31) => differentiability=0.68936

[SIFT_MY] Points detected: 1917 -> 676 (in 2.07579 sec)
[SIFT_MY] 1449/1917 (recall=0.755869) with average error=2.15053
[SIFT_MY] average size ratio between matched points: 1.0[25](https://github.com/PhotogrammetryCourse/PhotogrammetryTasks2024/actions/runs/8040524241/job/21958719078?pr=5#step:7:26)78
[SIFT_MY] average angle difference between matched points: -0.300901 degrees
[SIFT_MY] average descriptor distance between matched points: 1.19889 (random distance: 1.28791) => differentiability=0.930879

[       OK ] SIFT.Scale50 (2251 ms)
[ RUN      ] SIFT.Scale70
[ORB_OCV] Points detected: 500 -> 500 (in 0.013979 sec)
[ORB_OCV] 488/500 (recall=0.976) with average error=0.902066
[ORB_OCV] average size ratio between matched points: 0.884398
[ORB_OCV] average angle difference between matched points: 1.14689 degrees
[ORB_OCV] average descriptor distance between matched points: 70.2889 (random distance: 124.695) => differentiability=0.563688

[SIFTOCV] Points detected: 453 -> 335 (in 0.083908 sec)
[SIFTOCV] 307/453 (recall=0.677704) with average error=1.1649
[SIFTOCV] average size ratio between matched points: 0.92551
[SIFTOCV] average angle difference between matched points: -8.88537 degrees
[SIFTOCV] average descriptor distance between matched points: 272.272 (random distance: 530.603) => differentiability=0.513138

[SIFT_MY] Points detected: 1917 -> 966 (in 2.052 sec)
[SIFT_MY] 1475/1917 (recall=0.769431) with average error=1.68342
[SIFT_MY] average size ratio between matched points: 0.996819
[SIFT_MY] average angle difference between matched points: -2.05096 degrees
[SIFT_MY] average descriptor distance between matched points: 1.12963 (random distance: 1.28683) => differentiability=0.877842

[       OK ] SIFT.Scale70 (2230 ms)
[ RUN      ] SIFT.Scale90
[ORB_OCV] Points detected: 500 -> 500 (in 0.014141 sec)
[ORB_OCV] 489/500 (recall=0.978) with average error=0.823308
[ORB_OCV] average size ratio between matched points: 0.970324
[ORB_OCV] average angle difference between matched points: -0.183516 degrees
[ORB_OCV] average descriptor distance between matched points: 60.3333 (random distance: 125.059) => differentiability=0.482438

[SIFTOCV] Points detected: 453 -> 469 (in 0.087173 sec)
[SIFTOCV] 354/453 (recall=0.781457) with average error=0.59984
[SIFTOCV] average size ratio between matched points: 1.00052
[SIFTOCV] average angle difference between matched points: -4.5203 degrees
[SIFTOCV] average descriptor distance between matched points: 193.204 (random distance: 523.29) => differentiability=0.369209

[SIFT_MY] Points detected: 1917 -> 1486 (in 2.55689 sec)
[SIFT_MY] 1663/1917 (recall=0.867501) with average error=1.12903
[SIFT_MY] average size ratio between matched points: 1.01201
[SIFT_MY] average angle difference between matched points: -5.36086 degrees
[SIFT_MY] average descriptor distance between matched points: 0.900909 (random distance: 1.28478) => differentiability=0.701218

[       OK ] SIFT.Scale90 (2742 ms)
[ RUN      ] SIFT.Scale110
[ORB_OCV] Points detected: 500 -> 500 (in 0.0141 sec)
[ORB_OCV] 462/500 (recall=0.924) with average error=0.912118
[ORB_OCV] average size ratio between matched points: 1.02967
[ORB_OCV] average angle difference between matched points: -0.905967 degrees
[ORB_OCV] average descriptor distance between matched points: 59.7468 (random distance: 125.225) => differentiability=0.477115

[SIFTOCV] Points detected: 453 -> 600 (in 0.089906 sec)
[SIFTOCV] 349/434 (recall=0.804147) with average error=0.534994
[SIFTOCV] average size ratio between matched points: 1.1646
[SIFTOCV] average angle difference between matched points: -4.57053 degrees
[SIFTOCV] average descriptor distance between matched points: 182.986 (random distance: 530.751) => differentiability=0.344769

[SIFT_MY] Points detected: 1917 -> 1689 (in 2.76671 sec)
[SIFT_MY] 1510/1816 (recall=0.831498) with average error=0.852208
[SIFT_MY] average size ratio between matched points: 1.04845
[SIFT_MY] average angle difference between matched points: -6.977[26](https://github.com/PhotogrammetryCourse/PhotogrammetryTasks2024/actions/runs/8040524241/job/21958719078?pr=5#step:7:27) degrees
[SIFT_MY] average descriptor distance between matched points: 0.860487 (random distance: 1.[27](https://github.com/PhotogrammetryCourse/PhotogrammetryTasks2024/actions/runs/8040524241/job/21958719078?pr=5#step:7:28)338) => differentiability=0.675751

[       OK ] SIFT.Scale110 (2958 ms)
[ RUN      ] SIFT.Scale130
[ORB_OCV] Points detected: 500 -> 500 (in 0.014116 sec)
[ORB_OCV] 400/475 (recall=0.842105) with average error=1.02537
[ORB_OCV] average size ratio between matched points: 1.10237
[ORB_OCV] average angle difference between matched points: -4.78444 degrees
[ORB_OCV] average descriptor distance between matched points: 67.4875 (random distance: 126.4) => differentiability=0.53392

[SIFTOCV] Points detected: 453 -> 705 (in 0.089463 sec)
[SIFTOCV] 324/409 (recall=0.792176) with average error=0.534364
[SIFTOCV] average size ratio between matched points: 1.36874
[SIFTOCV] average angle difference between matched points: -4.48225 degrees
[SIFTOCV] average descriptor distance between matched points: 173.002 (random distance: 530.946) => differentiability=0.325837

[SIFT_MY] Points detected: 1917 -> 2002 (in 2.9819 sec)
[SIFT_MY] 1293/1643 (recall=0.786975) with average error=1.00841
[SIFT_MY] average size ratio between matched points: 1.13318
[SIFT_MY] average angle difference between matched points: -1.61813 degrees
[SIFT_MY] average descriptor distance between matched points: 1.05617 (random distance: 1.27449) => differentiability=0.8[28](https://github.com/PhotogrammetryCourse/PhotogrammetryTasks2024/actions/runs/8040524241/job/21958719078?pr=5#step:7:29)697

[       OK ] SIFT.Scale130 (3173 ms)
[ RUN      ] SIFT.Scale150
[ORB_OCV] Points detected: 500 -> 500 (in 0.014181 sec)
[ORB_OCV] 325/445 (recall=0.730337) with average error=1.18695
[ORB_OCV] average size ratio between matched points: 1.16446
[ORB_OCV] average angle difference between matched points: -1.92861 degrees
[ORB_OCV] average descriptor distance between matched points: 75.4954 (random distance: 125.905) => differentiability=0.599624

[SIFTOCV] Points detected: 453 -> 796 (in 0.090875 sec)
[SIFTOCV] 283/387 (recall=0.731266) with average error=0.48326
[SIFTOCV] average size ratio between matched points: 1.57659
[SIFTOCV] average angle difference between matched points: -7.53255 degrees
[SIFTOCV] average descriptor distance between matched points: 170.593 (random distance: 533.13) => differentiability=0.319983

[SIFT_MY] Points detected: 1917 -> 2253 (in 3.30044 sec)
[SIFT_MY] 1106/1509 (recall=0.73[29](https://github.com/PhotogrammetryCourse/PhotogrammetryTasks2024/actions/runs/8040524241/job/21958719078?pr=5#step:7:30)36) with average error=1.27913
[SIFT_MY] average size ratio between matched points: 1.20183
[SIFT_MY] average angle difference between matched points: -0.794214 degrees
[SIFT_MY] average descriptor distance between matched points: 1.14412 (random distance: 1.27227) => differentiability=0.89927

[       OK ] SIFT.Scale150 (3493 ms)
[ RUN      ] SIFT.Scale175
[ORB_OCV] Points detected: 500 -> 500 (in 0.014327 sec)
[ORB_OCV] 235/380 (recall=0.618421) with average error=1.3217
[ORB_OCV] average size ratio between matched points: 1.25586
[ORB_OCV] average angle difference between matched points: 4.1[30](https://github.com/PhotogrammetryCourse/PhotogrammetryTasks2024/actions/runs/8040524241/job/21958719078?pr=5#step:7:31)08 degrees
[ORB_OCV] average descriptor distance between matched points: 84.1617 (random distance: 124.894) => differentiability=0.673867

[SIFTOCV] Points detected: 453 -> 860 (in 0.091767 sec)
[SIFTOCV] 273/354 (recall=0.771186) with average error=0.549137
[SIFTOCV] average size ratio between matched points: 1.80138
[SIFTOCV] average angle difference between matched points: -1.28444 degrees
[SIFTOCV] average descriptor distance between matched points: 176.811 (random distance: 520.652) => differentiability=0.339596

[SIFT_MY] Points detected: 1917 -> 2454 (in 3.85801 sec)
[SIFT_MY] 872/1364 (recall=0.639296) with average error=1.61711
[SIFT_MY] average size ratio between matched points: 1.27344
[SIFT_MY] average angle difference between matched points: -2.33691 degrees
[SIFT_MY] average descriptor distance between matched points: 1.17783 (random distance: 1.27168) => differentiability=0.926197

[       OK ] SIFT.Scale175 (4054 ms)
[ RUN      ] SIFT.Scale200
[ORB_OCV] Points detected: 500 -> 500 (in 0.014294 sec)
[ORB_OCV] 174/333 (recall=0.522523) with average error=1.36043
[ORB_OCV] average size ratio between matched points: 1.34374
[ORB_OCV] average angle difference between matched points: -3.78969 degrees
[ORB_OCV] average descriptor distance between matched points: 86.1954 (random distance: 126.011) => differentiability=0.684028

[SIFTOCV] Points detected: 453 -> 811 (in 0.091387 sec)
[SIFTOCV] 250/324 (recall=0.771605) with average error=0.545408
[SIFTOCV] average size ratio between matched points: 2.04147
[SIFTOCV] average angle difference between matched points: -8.163 degrees
[SIFTOCV] average descriptor distance between matched points: 150.935 (random distance: 525.969) => differentiability=0.286966

[SIFT_MY] Points detected: 1917 -> 2837 (in 4.20668 sec)
[SIFT_MY] 721/1236 (recall=0.583333) with average error=2.06344
[SIFT_MY] average size ratio between matched points: 1.20804
[SIFT_MY] average angle difference between matched points: -2.99718 degrees
[SIFT_MY] average descriptor distance between matched points: 1.19195 (random distance: 1.26993) => differentiability=0.938596

[       OK ] SIFT.Scale200 (4406 ms)
[ RUN      ] SIFT.Rotate10Scale90
[ORB_OCV] Points detected: 500 -> 500 (in 0.014156 sec)
[ORB_OCV] 486/500 (recall=0.972) with average error=0.862656
[ORB_OCV] average size ratio between matched points: 1.00909
[ORB_OCV] average angle difference between matched points: 12.1602 degrees
[ORB_OCV] average descriptor distance between matched points: 61.9033 (random distance: 126.477) => differentiability=0.489442

[SIFTOCV] Points detected: 453 -> 464 (in 0.087096 sec)
[SIFTOCV] 351/453 (recall=0.774834) with average error=0.660494
[SIFTOCV] average size ratio between matched points: 0.970697
[SIFTOCV] average angle difference between matched points: 0.36928 degrees
[SIFTOCV] average descriptor distance between matched points: 210.278 (random distance: 528.178) => differentiability=0.39812

[SIFT_MY] Points detected: 1917 -> 1448 (in 2.48443 sec)
[SIFT_MY] 1619/1908 (recall=0.848532) with average error=1.19998
[SIFT_MY] average size ratio between matched points: 1.01887
[SIFT_MY] average angle difference between matched points: 1.68171 degrees
[SIFT_MY] average descriptor distance between matched points: 1.05092 (random distance: 1.2844) => differentiability=0.818217

[       OK ] SIFT.Rotate10Scale90 (2668 ms)
[ RUN      ] SIFT.Rotate30Scale75
[ORB_OCV] Points detected: 500 -> 500 (in 0.013899 sec)
[ORB_OCV] 471/500 (recall=0.942) with average error=0.873322
[ORB_OCV] average size ratio between matched points: 0.8828[31](https://github.com/PhotogrammetryCourse/PhotogrammetryTasks2024/actions/runs/8040524241/job/21958719078?pr=5#step:7:32)
[ORB_OCV] average angle difference between matched points: [32](https://github.com/PhotogrammetryCourse/PhotogrammetryTasks2024/actions/runs/8040524241/job/21958719078?pr=5#step:7:33).7295 degrees
[ORB_OCV] average descriptor distance between matched points: 68.9915 (random distance: 123.987) => differentiability=0.55644

[SIFTOCV] Points detected: 453 -> 373 (in 0.085439 sec)
[SIFTOCV] 318/453 (recall=0.701987) with average error=0.961622
[SIFTOCV] average size ratio between matched points: 0.958296
[SIFTOCV] average angle difference between matched points: 6.75176 degrees
[SIFTOCV] average descriptor distance between matched points: 241.741 (random distance: 528.552) => differentiability=0.457364

[SIFT_MY] Points detected: 1917 -> 1056 (in 2.23842 sec)
[SIFT_MY] 1450/1900 (recall=0.763158) with average error=1.61961
[SIFT_MY] average size ratio between matched points: 0.993719
[SIFT_MY] average angle difference between matched points: 9.77785 degrees
[SIFT_MY] average descriptor distance between matched points: 1.27222 (random distance: 1.28485) => differentiability=0.99017

[       OK ] SIFT.Rotate30Scale75 (2419 ms)
[ RUN      ] SIFT.HerzJesu19RotateM40
[ORB_OCV] Points detected: 500 -> 500 (in 0.224418 sec)
[ORB_OCV] 494/500 (recall=0.988) with average error=1.25431
[ORB_OCV] average size ratio between matched points: 1.00708
[ORB_OCV] average angle difference between matched points: -36.7101 degrees
[ORB_OCV] average descriptor distance between matched points: 48.3603 (random distance: 121.69) => differentiability=0.397405

[SIFTOCV] Points detected: 3154 -> 2639 (in 3.0391 sec)
[SIFTOCV] 2513/2588 (recall=0.97102) with average error=2.59085
[SIFTOCV] average size ratio between matched points: 1.07519
[SIFTOCV] average angle difference between matched points: -21.32[34](https://github.com/PhotogrammetryCourse/PhotogrammetryTasks2024/actions/runs/8040524241/job/21958719078?pr=5#step:7:35) degrees
[SIFTOCV] average descriptor distance between matched points: 188.891 (random distance: 524.107) => differentiability=0.360407

[SIFT_MY] Points detected: 18446 -> 12649 (in 69.49[35](https://github.com/PhotogrammetryCourse/PhotogrammetryTasks2024/actions/runs/8040524241/job/21958719078?pr=5#step:7:36) sec)
[SIFT_MY] 14387/14725 (recall=0.977046) with average error=3.82185
[SIFT_MY] average size ratio between matched points: 1.0256
[SIFT_MY] average angle difference between matched points: -16.7213 degrees
[SIFT_MY] average descriptor distance between matched points: 1.26624 (random distance: 1.228[36](https://github.com/PhotogrammetryCourse/PhotogrammetryTasks2024/actions/runs/8040524241/job/21958719078?pr=5#step:7:37)) => differentiability=1.03084

[       OK ] SIFT.HerzJesu19RotateM40 (75157 ms)
[----------] 22 tests from SIFT (1[37](https://github.com/PhotogrammetryCourse/PhotogrammetryTasks2024/actions/runs/8040524241/job/21958719078?pr=5#step:7:38)7[42](https://github.com/PhotogrammetryCourse/PhotogrammetryTasks2024/actions/runs/8040524241/job/21958719078?pr=5#step:7:43) ms total)

[----------] Global test environment tear-down
[==========] 22 tests from 1 test suite ran. (137[74](https://github.com/PhotogrammetryCourse/PhotogrammetryTasks2024/actions/runs/8040524241/job/21958719078?pr=5#step:7:75)2 ms total)
[  PASSED  ] 22 tests.

@PolarNick239
Copy link
Member

1 При этом ORIENTATION_VOTES_PEAK_RATIO=0.999 уменьшит количество детектируемых ключевых точек, при этом не повлияет на точность определения угла.

почему он уменьшает количество точек? и точно ли он не влияет на точность определения угла? если например у меня будет ключевая точка (красный центр, см. ниже) вокруг которой окрестность такова что много градиентов смотрящих вверх и много градиентов смотрящих влево - какой угол направления будет определен?

Screenshot_20240226_205526

6 Разве не в этом вся суть DoG? Почему они вообще должны быть похожи у разных слоев?

не должны быть похожи, разные частоты - разные слои DoG

9 Строчка 409: orientation = (orientation + 90.0 + angle); (догадался если честно не сам)

хорошо что сказали :) а вот представьте что вы знаете в общих чертах алгоритм SIFT и вам подсунули чужой код, и в задании сказано что нужно найти строку где достигается инвариантность по повороту - как эту строку найти чисто технически не включая мозг? например до чего она должна быть (т.е. на каикх логических этапах она используется уж точно)? и после каких логических этапов она должна быть?

все хорошо, осталось ответить на вопросы 1 и 9

@capitanFlint129
Copy link
Author

capitanFlint129 commented Feb 28, 2024

  1. В данном вопросе я возможно плохо понял назначение ORIENTATION_VOTES_PEAK_RATIO , но попробую ответить

почему он уменьшает количество точек?

Если я правильно понял, то низкий ORIENTATION_VOTES_PEAK_RATIO приведет к тому, что мы будем строить дополнительные дескрипторы ключевых точек для тех же координат. Разве строчка if (value > prevValue && value > nextValue && votes[bin] > biggestVote * ORIENTATION_VOTES_PEAK_RATIO) { не отвечает за это?

и точно ли он не влияет на точность определения угла?

Заметил сейчас, что в тестах берется ближайшая к эталонной ключевая точка по расстоянию в пикселях (а не по дескриптору как я сначала подумал) . То есть мы можем сматчить с одной ключевой точкой трансформированного изображения много ключевых точек с одинаковой координатой, но разным ориентациями с изначального изображения. То есть как минимум в тестах угол все-таки должен определяться точнее (сейчас перепроверил, вроде так и есть, в первый раз возможно накосячил где-то), поскольку у нас будет меньше направлений для одних и тех же координат и в следствии меньше неправильных сопоставлений. Но мне не понятно почему идейно с точки зрения алгоритма такой параметр должен что-то улучшать, у нас ведь в хорошем случае на преобразованной картинке также будет несколько дескрипторов с разными направлениями? А то что мы отсеиваем более слабые просто будет влиять на количество дескрипторов?

То есть вопрос в том, если бы мы в тестах использовали и близость дескрипторов и близость по пикселям (в каком-то хорошо подобранном соотношении) как критерий для сопоставления точек, влиял бы на точность определения угла ORIENTATION_VOTES_PEAK_RATIO?

если например у меня будет ключевая точка (красный центр, см. ниже) вокруг которой окрестность такова что много градиентов смотрящих вверх и много градиентов смотрящих влево - какой угол направления будет определен?

Если голос за синее и за зеленое направление будет примерно одинаковый, то даже при высоком ORIENTATION_VOTES_PEAK_RATIO мы определим две ключевые точки, насколько я понимаю. Если голоса достаточно разные, то мы определим одну ключевую точку с направлением с большим голосом

не должны быть похожи, разные частоты - разные слои DoG

Аа, просто я интерпретировал подсказку в коде "подумайте с чем должна визуально совпадать картинка из октавы DoG? может быть с какой-то из картинок с предыдущей октавы?", как то что у разных октав мы ожидаем одинаковые пятна на каких-то слоях

  1. Такая строчка должна быть после:
  • построения пирамиды Гауссиан и пирамиды DoG (потому что без них никакой другой этап не возможно сделать)
  • определения координат ключевых точек (потому что для построения дескриптора нам собственно нужно понимать где их строить)
  • определения масштаба ключевой точки (потому что без знания масштаба мы не можем понять по какой окрестности определять ориентацию ключевой точки так чтобы это было инвариантно к масштабу)
  • определения ориентации ключевой точки (потому что не зная ориентацию мы не сможем внести правильную поправку)
  • определения ориентации конкретного градиента (потому что это собственно то место, где мы добиваемся инвариантности к повороту)

Также такая строчка должна быть до того как мы прибавим силу градиента в наш итоговый вектор-дескриптор, поскольку поправка на этот угол может поменять соотношения различных компонент вектора

@PolarNick239
Copy link
Member

Если я правильно понял, то низкий ORIENTATION_VOTES_PEAK_RATIO приведет к тому, что мы будем строить дополнительные дескрипторы ключевых точек для тех же координат. Разве строчка if (value > prevValue && value > nextValue && votes[bin] > biggestVote * ORIENTATION_VOTES_PEAK_RATIO) { не отвечает за это?

да, все так

То есть вопрос в том, если бы мы в тестах использовали и близость дескрипторов и близость по пикселям (в каком-то хорошо подобранном соотношении) как критерий для сопоставления точек, влиял бы на точность определения угла ORIENTATION_VOTES_PEAK_RATIO?

да, его увеличение "увеличивает" точность только из-за методики измерения точности и т.п., по-хорошему конечно более качественный результат достигается если делать дубликаты точки (дубликат для каждого из мажорирующих направлений - мажорирующих почти так же как самое сильное направление)

Если голос за синее и за зеленое направление будет примерно одинаковый, то даже при высоком ORIENTATION_VOTES_PEAK_RATIO мы определим две ключевые точки, насколько я понимаю. Если голоса достаточно разные, то мы определим одну ключевую точку с направлением с большим голосом

ага, все так

Также такая строчка должна быть до того как мы прибавим силу градиента в наш итоговый вектор-дескриптор, поскольку поправка на этот угол может поменять соотношения различных компонент вектора

ага, т.е. довольно забавно что можно прокачать навык Шерлок-Холмса-Робота и находить нужные куски кода идя по логической причино-следственной цепочке, тем сам сильно наловчиться читать не только свой код, но и чужой без проблем

@PolarNick239
Copy link
Member

все очень здорово, 8/8 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants