Skip to content

Task02 Данила Ярмаркин ИТМО#50

Open
danyarmarkin wants to merge 5 commits intoPhotogrammetryCourse:task02from
danyarmarkin:task02
Open

Task02 Данила Ярмаркин ИТМО#50
danyarmarkin wants to merge 5 commits intoPhotogrammetryCourse:task02from
danyarmarkin:task02

Conversation

@danyarmarkin
Copy link

@danyarmarkin danyarmarkin commented Mar 20, 2026

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

  1. Зачем фильтровать матчи, если потом мы запускаем устойчивый к выбросам RANSAC и отфильтровываем шумные сопоставления?

Потому что RANSAC устойчив к выбросам. Если "выбросов" в изначальной выборке много, они перестают быть выбросами и RANSAC покажет результаты хуже

  1. Cluster filtering довольно хорошо работает и без Ratio test. Однако, если оставить только Cluster filtering, некоторые тесты начнут падать. Почему так происходит? В каких случаях наоборот, не хватает Ratio test и необходима дополнительная фильтрация?

Сжатие кластеров не устойчиво к скейлу. Сломаться всё может, когда у нас встречается часто повторяющийся паттерн текстуры

  1. С какой проблемой можно столкнуться при приравнивании единице элемента H33 матрицы гомографии? Как ее решить?

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

  1. Какой подвох таится в попытке склеивать большие панорамы и ортофото методом, реализованным в данной домашке? (Для интуиции можно посмотреть на результат склейки, когда за корень взята какая-нибудь другая картинка)

Вероятно, там накапливается ошибка, если большая цепочка последовательных кадров, поэтому в конце все может поплыть

  1. Как можно автоматически построить граф для построения панорамы, чтобы на вход метод принимал только список картинок?

Мб идея тупая, но можно построить граф, через алгоритм максимального потока, где на ребрах количество совпадений

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

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

  1. Если есть, фидбек по заданию: какая часть больше всего понравилась, где-то слишком сложно/просто (что именно), где-то слишком мало ссылок и тд.
Github Actions CI

[==========] Running 20 tests from 2 test suites.
[----------] Global test environment set-up.
[----------] 18 tests from MATCHING
[ RUN      ] MATCHING.SimpleStitching
testing sift detector/descriptor...
estimateHomographyRANSAC : support: 1005/1005
estimateHomographyRANSAC : best support: 1005/1005
keypoints RMSE: 0.116319, color RMSE: 5.6938
[       OK ] MATCHING.SimpleStitching (612 ms)
[ RUN      ] MATCHING.SimpleMatching
testing sift detector/descriptor...
flann matching...
cv flann matching...
brute force matching
BruteforceMatcher::knnMatch : n query desc : 3919, n train desc : 3522
filtering matches by ratio test...
filtering matches by clusters...
filtering matches by ratio & clusters
estimating homography...
estimateHomographyRANSAC : support: 1007/1007
estimateHomographyRANSAC : best support: 1007/1007
evaluating homography...
nn_score: 0.606277, nn2_score: 0.262822, nn_score_cv: 0.615463, nn2_score_cv: 0.27507, time_my: 0.04331, time_cv: 0.040032, time_bruteforce: 5.39569, good_nn: 0.260781, good_ratio: 0.979749, good_clusters: 0.987784, good_ratio_and_clusters: 0.999007
[       OK ] MATCHING.SimpleMatching (5723 ms)
[ RUN      ] MATCHING.Rotate10
testing sift detector/descriptor...
flann matching...
cv flann matching...
filtering matches by ratio test...
filtering matches by clusters...
filtering matches by ratio & clusters
estimating homography...
estimateHomographyRANSAC : support: 394/754
estimateHomographyRANSAC : support: 751/754
estimateHomographyRANSAC : support: 753/754
estimateHomographyRANSAC : best support: 753/754
evaluating homography...
nn_score: 0, nn2_score: 0, nn_score_cv: 0, nn2_score_cv: 0, time_my: 0.057212, time_cv: 0.068485, time_bruteforce: 0, good_nn: 0.184996, good_ratio: 0.90874, good_clusters: 0.928205, good_ratio_and_clusters: 0.932361
[       OK ] MATCHING.Rotate10 (676 ms)
[ RUN      ] MATCHING.Rotate20
testing sift detector/descriptor...
flann matching...
cv flann matching...
filtering matches by ratio test...
filtering matches by clusters...
filtering matches by ratio & clusters
estimating homography...
estimateHomographyRANSAC : support: 81/763
estimateHomographyRANSAC : support: 109/763
estimateHomographyRANSAC : support: 716/763
estimateHomographyRANSAC : support: 763/763
estimateHomographyRANSAC : best support: 763/763
evaluating homography...
nn_score: 0, nn2_score: 0, nn_score_cv: 0, nn2_score_cv: 0, time_my: 0.056238, time_cv: 0.047435, time_bruteforce: 0, good_nn: 0.201072, good_ratio: 0.961395, good_clusters: 0.971867, good_ratio_and_clusters: 0.993447
[       OK ] MATCHING.Rotate20 (446 ms)
[ RUN      ] MATCHING.Rotate30
testing sift detector/descriptor...
flann matching...
cv flann matching...
filtering matches by ratio test...
filtering matches by clusters...
filtering matches by ratio & clusters
estimating homography...
estimateHomographyRANSAC : support: 736/747
estimateHomographyRANSAC : support: 746/747
estimateHomographyRANSAC : best support: 746/747
evaluating homography...
nn_score: 0, nn2_score: 0, nn_score_cv: 0, nn2_score_cv: 0, time_my: 0.052417, time_cv: 0.048155, time_bruteforce: 0, good_nn: 0.181169, good_ratio: 0.895619, good_clusters: 0.917582, good_ratio_and_clusters: 0.921017
[       OK ] MATCHING.Rotate30 (464 ms)
[ RUN      ] MATCHING.Rotate40
testing sift detector/descriptor...
flann matching...
cv flann matching...
filtering matches by ratio test...
filtering matches by clusters...
filtering matches by ratio & clusters
estimating homography...
estimateHomographyRANSAC : support: 750/757
estimateHomographyRANSAC : support: 757/757
estimateHomographyRANSAC : best support: 757/757
evaluating homography...
nn_score: 0, nn2_score: 0, nn_score_cv: 0, nn2_score_cv: 0, time_my: 0.055059, time_cv: 0.050589, time_bruteforce: 0, good_nn: 0.197755, good_ratio: 0.970513, good_clusters: 0.967254, good_ratio_and_clusters: 0.990753
[       OK ] MATCHING.Rotate40 (445 ms)
[ RUN      ] MATCHING.Rotate45
testing sift detector/descriptor...
flann matching...
cv flann matching...
filtering matches by ratio test...
filtering matches by clusters...
filtering matches by ratio & clusters
estimating homography...
estimateHomographyRANSAC : support: 445/758
estimateHomographyRANSAC : support: 719/758
estimateHomographyRANSAC : support: 757/758
gauss: infinitely many solutions found
gauss: xs0: 678.857, 806.915, 804.292, 678.857, 
gauss: ys0: 621.485, 616.651, 255.102, 621.485, 
estimateHomographyRANSAC : best support: 757/758
evaluating homography...
nn_score: 0, nn2_score: 0, nn_score_cv: 0, nn2_score_cv: 0, time_my: 0.056799, time_cv: 0.05437, time_bruteforce: 0, good_nn: 0.188058, good_ratio: 0.928571, good_clusters: 0.950581, good_ratio_and_clusters: 0.956464
[       OK ] MATCHING.Rotate45 (505 ms)
[ RUN      ] MATCHING.Rotate90
testing sift detector/descriptor...
flann matching...
cv flann matching...
filtering matches by ratio test...
filtering matches by clusters...
filtering matches by ratio & clusters
estimating homography...
estimateHomographyRANSAC : support: 757/828
estimateHomographyRANSAC : support: 827/828
estimateHomographyRANSAC : best support: 827/828
evaluating homography...
nn_score: 0, nn2_score: 0, nn_score_cv: 0, nn2_score_cv: 0, time_my: 0.049281, time_cv: 0.053482, time_bruteforce: 0, good_nn: 0.213065, good_ratio: 0.964912, good_clusters: 0.974771, good_ratio_and_clusters: 0.986715
[       OK ] MATCHING.Rotate90 (479 ms)
[ RUN      ] MATCHING.Scale50
testing sift detector/descriptor...
flann matching...
cv flann matching...
filtering matches by ratio test...
filtering matches by clusters...
filtering matches by ratio & clusters
estimating homography...
estimateHomographyRANSAC : support: 149/167
estimateHomographyRANSAC : support: 162/167
estimateHomographyRANSAC : support: 167/167
estimateHomographyRANSAC : best support: 167/167
evaluating homography...
too few matches: 0
nn_score: 0, nn2_score: 0, nn_score_cv: 0, nn2_score_cv: 0, time_my: 0.027949, time_cv: 0.026437, time_bruteforce: 0, good_nn: 0.0415922, good_ratio: 0.744076, good_clusters: 0, good_ratio_and_clusters: 0.916168
[       OK ] MATCHING.Scale50 (240 ms)
[ RUN      ] MATCHING.Scale70
testing sift detector/descriptor...
flann matching...
cv flann matching...
filtering matches by ratio test...
filtering matches by clusters...
filtering matches by ratio & clusters
estimating homography...
estimateHomographyRANSAC : support: 374/374
estimateHomographyRANSAC : best support: 374/374
evaluating homography...
too few matches: 39
nn_score: 0, nn2_score: 0, nn_score_cv: 0, nn2_score_cv: 0, time_my: 0.036145, time_cv: 0.034643, time_bruteforce: 0, good_nn: 0.0819087, good_ratio: 0.768657, good_clusters: 0, good_ratio_and_clusters: 0.818182
[       OK ] MATCHING.Scale70 (324 ms)
[ RUN      ] MATCHING.Scale90
testing sift detector/descriptor...
flann matching...
cv flann matching...
filtering matches by ratio test...
filtering matches by clusters...
filtering matches by ratio & clusters
estimating homography...
estimateHomographyRANSAC : support: 517/649
estimateHomographyRANSAC : support: 649/649
estimateHomographyRANSAC : best support: 649/649
evaluating homography...
nn_score: 0, nn2_score: 0, nn_score_cv: 0, nn2_score_cv: 0, time_my: 0.043726, time_cv: 0.045445, time_bruteforce: 0, good_nn: 0.157438, good_ratio: 0.890555, good_clusters: 0.916318, good_ratio_and_clusters: 0.912173
[       OK ] MATCHING.Scale90 (384 ms)
[ RUN      ] MATCHING.Scale110
testing sift detector/descriptor...
flann matching...
cv flann matching...
filtering matches by ratio test...
filtering matches by clusters...
filtering matches by ratio & clusters
estimating homography...
estimateHomographyRANSAC : support: 790/790
estimateHomographyRANSAC : best support: 790/790
evaluating homography...
nn_score: 0, nn2_score: 0, nn_score_cv: 0, nn2_score_cv: 0, time_my: 0.064551, time_cv: 0.062919, time_bruteforce: 0, good_nn: 0.202858, good_ratio: 0.960543, good_clusters: 0.971302, good_ratio_and_clusters: 0.979747
[       OK ] MATCHING.Scale110 (612 ms)
[ RUN      ] MATCHING.Scale130
testing sift detector/descriptor...
flann matching...
cv flann matching...
filtering matches by ratio test...
filtering matches by clusters...
filtering matches by ratio & clusters
estimating homography...
estimateHomographyRANSAC : support: 59/837
estimateHomographyRANSAC : support: 354/837
estimateHomographyRANSAC : support: 460/837
estimateHomographyRANSAC : support: 563/837
estimateHomographyRANSAC : support: 819/837
estimateHomographyRANSAC : support: 836/837
estimateHomographyRANSAC : best support: 836/837
evaluating homography...
nn_score: 0, nn2_score: 0, nn_score_cv: 0, nn2_score_cv: 0, time_my: 0.134648, time_cv: 0.15416, time_bruteforce: 0, good_nn: 0.216382, good_ratio: 0.955069, good_clusters: 0.972387, good_ratio_and_clusters: 0.978495
[       OK ] MATCHING.Scale130 (1023 ms)
[ RUN      ] MATCHING.Scale150
testing sift detector/descriptor...
flann matching...
cv flann matching...
filtering matches by ratio test...
filtering matches by clusters...
filtering matches by ratio & clusters
estimating homography...
estimateHomographyRANSAC : support: 780/783
estimateHomographyRANSAC : support: 781/783
estimateHomographyRANSAC : support: 782/783
gauss: infinitely many solutions found
gauss: xs0: 807.913, 603.203, 688.099, 603.203, 
gauss: ys0: 375.441, 531.672, 255.117, 531.672, 
estimateHomographyRANSAC : best support: 782/783
evaluating homography...
nn_score: 0, nn2_score: 0, nn_score_cv: 0, nn2_score_cv: 0, time_my: 0.115479, time_cv: 0.167178, time_bruteforce: 0, good_nn: 0.201072, good_ratio: 0.951733, good_clusters: 0.952688, good_ratio_and_clusters: 0.968072
[       OK ] MATCHING.Scale150 (1556 ms)
[ RUN      ] MATCHING.Scale175
testing sift detector/descriptor...
flann matching...
cv flann matching...
filtering matches by ratio test...
filtering matches by clusters...
filtering matches by ratio & clusters
estimating homography...
estimateHomographyRANSAC : support: 726/770
estimateHomographyRANSAC : support: 768/770
estimateHomographyRANSAC : best support: 768/770
evaluating homography...
nn_score: 0, nn2_score: 0, nn_score_cv: 0, nn2_score_cv: 0, time_my: 0.180646, time_cv: 0.180795, time_bruteforce: 0, good_nn: 0.180913, good_ratio: 0.870765, good_clusters: 0.893939, good_ratio_and_clusters: 0.888312
[       OK ] MATCHING.Scale175 (1612 ms)
[ RUN      ] MATCHING.Scale200
testing sift detector/descriptor...
flann matching...
cv flann matching...
filtering matches by ratio test...
filtering matches by clusters...
filtering matches by ratio & clusters
estimating homography...
estimateHomographyRANSAC : support: 652/853
estimateHomographyRANSAC : support: 772/853
estimateHomographyRANSAC : support: 832/853
estimateHomographyRANSAC : support: 850/853
estimateHomographyRANSAC : support: 851/853
gauss: infinitely many solutions found
gauss: xs0: 727.517, 757.375, 727.517, 578.574, 
gauss: ys0: 503.59, 441.789, 503.59, 471.335, 
estimateHomographyRANSAC : best support: 851/853
evaluating homography...
nn_score: 0, nn2_score: 0, nn_score_cv: 0, nn2_score_cv: 0, time_my: 0.188936, time_cv: 0.20156, time_bruteforce: 0, good_nn: 0.221485, good_ratio: 0.970522, good_clusters: 0.992322, good_ratio_and_clusters: 0.989449
[       OK ] MATCHING.Scale200 (2212 ms)
[ RUN      ] MATCHING.Rotate10Scale90
testing sift detector/descriptor...
flann matching...
cv flann matching...
filtering matches by ratio test...
filtering matches by clusters...
filtering matches by ratio & clusters
estimating homography...
estimateHomographyRANSAC : support: 22/643
estimateHomographyRANSAC : support: 598/643
estimateHomographyRANSAC : support: 627/643
estimateHomographyRANSAC : support: 640/643
estimateHomographyRANSAC : support: 643/643
estimateHomographyRANSAC : best support: 643/643
evaluating homography...
nn_score: 0, nn2_score: 0, nn_score_cv: 0, nn2_score_cv: 0, time_my: 0.075176, time_cv: 0.068065, time_bruteforce: 0, good_nn: 0.172493, good_ratio: 0.968516, good_clusters: 0.970954, good_ratio_and_clusters: 0.992224
[       OK ] MATCHING.Rotate10Scale90 (536 ms)
[ RUN      ] MATCHING.Rotate30Scale75
testing sift detector/descriptor...
flann matching...
cv flann matching...
filtering matches by ratio test...
filtering matches by clusters...
filtering matches by ratio & clusters
estimating homography...
estimateHomographyRANSAC : support: 435/437
gauss: infinitely many solutions found
gauss: xs0: 665.185, 678.206, 648.948, 665.185, 
gauss: ys0: 377.14, 524.24, 596.863, 377.14, 
estimateHomographyRANSAC : best support: 435/437
evaluating homography...
nn_score: 0, nn2_score: 0, nn_score_cv: 0, nn2_score_cv: 0, time_my: 0.040351, time_cv: 0.040441, time_bruteforce: 0, good_nn: 0.109212, good_ratio: 0.887665, good_clusters: 0.911111, good_ratio_and_clusters: 0.91762
[       OK ] MATCHING.Rotate30Scale75 (407 ms)
[----------] 18 tests from MATCHING (18257 ms total)

[----------] 2 tests from STITCHING
[ RUN      ] STITCHING.SimplePanorama
estimateHomographyRANSAC : support: 1007/1010
estimateHomographyRANSAC : support: 1008/1010
gauss: infinitely many solutions found
gauss: xs0: 72.676, 259.508, 110.29, 72.676, 
gauss: ys0: 462.852, 515.776, 453.172, 462.852, 
estimateHomographyRANSAC : best support: 1008/1010
bbox: [1285.68, 640.81], [0, -1.22268]
[       OK ] STITCHING.SimplePanorama (617 ms)
[ RUN      ] STITCHING.Orthophoto
estimateHomographyRANSAC : support: 66/1056
estimateHomographyRANSAC : support: 208/1056
estimateHomographyRANSAC : support: 315/1056
estimateHomographyRANSAC : support: 350/1056
estimateHomographyRANSAC : support: 533/1056
estimateHomographyRANSAC : best support: 533/1056
estimateHomographyRANSAC : support: 226/1384
estimateHomographyRANSAC : support: 255/1384
estimateHomographyRANSAC : support: 493/1384
estimateHomographyRANSAC : best support: 493/1384
estimateHomographyRANSAC : support: 262/2089
estimateHomographyRANSAC : support: 289/2089
estimateHomographyRANSAC : support: 298/2089
estimateHomographyRANSAC : support: 498/2089
estimateHomographyRANSAC : support: 692/2089
estimateHomographyRANSAC : best support: 692/2089
estimateHomographyRANSAC : support: 40/1244
estimateHomographyRANSAC : support: 89/1244
estimateHomographyRANSAC : support: 294/1244
estimateHomographyRANSAC : support: 361/1244
estimateHomographyRANSAC : support: 552/1244
estimateHomographyRANSAC : best support: 552/1244
bbox: [1360.21, 1864.28], [-232.041, -486.394]
estimateHomographyRANSAC : support: 234/1077
estimateHomographyRANSAC : support: 325/1077
estimateHomographyRANSAC : support: 387/1077
estimateHomographyRANSAC : best support: 387/1077
estimateHomographyRANSAC : support: 307/1390
estimateHomographyRANSAC : support: 544/1390
estimateHomographyRANSAC : support: 556/1390
estimateHomographyRANSAC : support: 588/1390
estimateHomographyRANSAC : best support: 588/1390
estimateHomographyRANSAC : support: 424/2090
estimateHomographyRANSAC : support: 501/2090
estimateHomographyRANSAC : support: 607/2090
estimateHomographyRANSAC : best support: 607/2090
estimateHomographyRANSAC : support: 8/1236
estimateHomographyRANSAC : support: 268/1236
estimateHomographyRANSAC : support: 410/1236
estimateHomographyRANSAC : support: 501/1236
estimateHomographyRANSAC : support: 532/1236
estimateHomographyRANSAC : best support: 532/1236
bbox: [1152, 864], [-364.332, -1141.5]
n stable ortho kpts: : 20306
[       OK ] STITCHING.Orthophoto (18395 ms)
[----------] 2 tests from STITCHING (19012 ms total)

[----------] Global test environment tear-down
[==========] 20 tests from 2 test suites ran. (37269 ms total)
[  PASSED  ] 20 tests.

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.

1 participant