Skip to content

Task02 Денис Ловцев ИТМО#42

Open
SheLesTT wants to merge 6 commits intoPhotogrammetryCourse:task02from
SheLesTT:task02
Open

Task02 Денис Ловцев ИТМО#42
SheLesTT wants to merge 6 commits intoPhotogrammetryCourse:task02from
SheLesTT:task02

Conversation

@SheLesTT
Copy link

@SheLesTT SheLesTT commented Mar 18, 2026

// Убедитесь что название PR соответствует шаблону:

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

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

Что бы найти гомографию по 4 точкам в зашумленном датасете RANSAC нужно запустить очень много раз, еще и есть риск, что корректный ответ он так и не найдет.

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

Cluster filtering смотрит только на геометрическое расположение матчей. Если на фото есть структуры похожие друг на друга, то может быть целый кластер ложных матчей. С другой стороны, если структуры повторяющиеся, до разница между дескрипторами скорее всего небольшая и Ratio test отсечет их как матчи в которых мы не уверены.

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

Если изначально значение элемента было очень маленьким. То во время нормировки матрицы H все остальные коэффициенты наоборот станут очень большим, что приводит к различным численным проблемам
На лекциях в таких случаях предлагалось искать решение используя метод SVD.

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

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

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

Поматчить все пары картинок, для каждой посчитать количество инлаеров. Из картинок, которые хорошо матчатся составить граф, на ребра можно добавить вес в виде количества инлаеров. Далее строим минимальное остовное дерево, максимизируя при этом количество инлаеров. И чтобы избежать проблем из пункта 4 за корень берем центр дерева.

// Создайте PR.
// Дождитесь отработки Github Actions CI, после чего нажмите на зеленую галочку -> Details -> The build -> скопируйте весь лог тестирования.
// Откройте PR на редактирование (сверху справа три точки->Edit) и добавьте сюда скопированный лог тестирования внутри тега

 для сохранения форматирования и под спойлером для компактности и удобства:

Github Actions CI

Run ./build/test_matching
Running main() from /home/runner/work/PhotogrammetryTasks2026/PhotogrammetryTasks2026/libs/3rdparty/libgtest/googletest/src/gtest_main.cc
[==========] Running 20 tests from 2 test suites.
[----------] Global test environment set-up.
[----------] 18 tests from MATCHING
[ RUN      ] MATCHING.SimpleStitching
testing sift detector/descriptor...
Get total 996 matches.
keypoints RMSE: 4.72619, color RMSE: 5.6938
[       OK ] MATCHING.SimpleStitching (463 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
Get total 993 matches.
estimating homography...
evaluating homography...
nn_score: 0.607553, nn2_score: 0.268181, nn_score_cv: 0.607553, nn2_score_cv: 0.268181, time_my: 0, time_cv: 0.082751, time_bruteforce: 4.50212, good_nn: 0.260781, good_ratio: 0, good_clusters: 0, good_ratio_and_clusters: 0.986908
[       OK ] MATCHING.SimpleMatching (4921 ms)
[ RUN      ] MATCHING.Rotate10
testing sift detector/descriptor...
flann matching...
cv flann matching...
Get total 743 matches.
estimating homography...
evaluating homography...
nn_score: 0, nn2_score: 0, nn_score_cv: 0, nn2_score_cv: 0, time_my: 0, time_cv: 0.105626, time_bruteforce: 0, good_nn: 0.201837, good_ratio: 0, good_clusters: 0, good_ratio_and_clusters: 0.994616
[       OK ] MATCHING.Rotate10 (583 ms)
[ RUN      ] MATCHING.Rotate20
testing sift detector/descriptor...
flann matching...
cv flann matching...
Get total 748 matches.
estimating homography...
evaluating homography...
nn_score: 0, nn2_score: 0, nn_score_cv: 0, nn2_score_cv: 0, time_my: 1e-06, time_cv: 0.105693, time_bruteforce: 0, good_nn: 0.204134, good_ratio: 0, good_clusters: 0, good_ratio_and_clusters: 0.985294
[       OK ] MATCHING.Rotate20 (578 ms)
[ RUN      ] MATCHING.Rotate30
testing sift detector/descriptor...
flann matching...
cv flann matching...
Get total 733 matches.
estimating homography...
evaluating homography...
nn_score: 0, nn2_score: 0, nn_score_cv: 0, nn2_score_cv: 0, time_my: 0, time_cv: 0.107456, time_bruteforce: 0, good_nn: 0.200561, good_ratio: 0, good_clusters: 0, good_ratio_and_clusters: 0.982265
[       OK ] MATCHING.Rotate30 (570 ms)
[ RUN      ] MATCHING.Rotate40
testing sift detector/descriptor...
flann matching...
cv flann matching...
Get total 729 matches.
estimating homography...
evaluating homography...
nn_score: 0, nn2_score: 0, nn_score_cv: 0, nn2_score_cv: 0, time_my: 0, time_cv: 0.10755, time_bruteforce: 0, good_nn: 0.201072, good_ratio: 0, good_clusters: 0, good_ratio_and_clusters: 0.984911
[       OK ] MATCHING.Rotate40 (576 ms)
[ RUN      ] MATCHING.Rotate45
testing sift detector/descriptor...
flann matching...
cv flann matching...
Get total 725 matches.
estimating homography...
evaluating homography...
nn_score: 0, nn2_score: 0, nn_score_cv: 0, nn2_score_cv: 0, time_my: 0, time_cv: 0.107797, time_bruteforce: 0, good_nn: 0.200306, good_ratio: 0, good_clusters: 0, good_ratio_and_clusters: 0.986207
[       OK ] MATCHING.Rotate45 (578 ms)
[ RUN      ] MATCHING.Rotate90
testing sift detector/descriptor...
flann matching...
cv flann matching...
Get total 837 matches.
estimating homography...
evaluating homography...
nn_score: 0, nn2_score: 0, nn_score_cv: 0, nn2_score_cv: 0, time_my: 0, time_cv: 0.094743, time_bruteforce: 0, good_nn: 0.218423, good_ratio: 0, good_clusters: 0, good_ratio_and_clusters: 0.990442
[       OK ] MATCHING.Rotate90 (552 ms)
[ RUN      ] MATCHING.Scale50
[       OK ] MATCHING.Scale50 (0 ms)
[ RUN      ] MATCHING.Scale70
testing sift detector/descriptor...
flann matching...
cv flann matching...
Get total 345 matches.
estimating homography...
evaluating homography...
nn_score: 0, nn2_score: 0, nn_score_cv: 0, nn2_score_cv: 0, time_my: 0, time_cv: 0.064514, time_bruteforce: 0, good_nn: 0.102832, good_ratio: 0, good_clusters: 0, good_ratio_and_clusters: 0.95942
[       OK ] MATCHING.Scale70 (396 ms)
[ RUN      ] MATCHING.Scale90
testing sift detector/descriptor...
flann matching...
cv flann matching...
Get total 662 matches.
estimating homography...
evaluating homography...
nn_score: 0, nn2_score: 0, nn_score_cv: 0, nn2_score_cv: 0, time_my: 0, time_cv: 0.084919, time_bruteforce: 0, good_nn: 0.174024, good_ratio: 0, good_clusters: 0, good_ratio_and_clusters: 0.97281
[       OK ] MATCHING.Scale90 (528 ms)
[ RUN      ] MATCHING.Scale110
testing sift detector/descriptor...
flann matching...
cv flann matching...
Get total 799 matches.
estimating homography...
evaluating homography...
nn_score: 0, nn2_score: 0, nn_score_cv: 0, nn2_score_cv: 0, time_my: 0, time_cv: 0.118819, time_bruteforce: 0, good_nn: 0.211023, good_ratio: 0, good_clusters: 0, good_ratio_and_clusters: 0.986233
[       OK ] MATCHING.Scale110 (630 ms)
[ RUN      ] MATCHING.Scale130
testing sift detector/descriptor...
flann matching...
cv flann matching...
Get total 850 matches.
estimating homography...
evaluating homography...
nn_score: 0, nn2_score: 0, nn_score_cv: 0, nn2_score_cv: 0, time_my: 0, time_cv: 0.169473, time_bruteforce: 0, good_nn: 0.221995, good_ratio: 0, good_clusters: 0, good_ratio_and_clusters: 0.989412
[       OK ] MATCHING.Scale130 (814 ms)
[ RUN      ] MATCHING.Scale150
testing sift detector/descriptor...
flann matching...
cv flann matching...
Get total 790 matches.
estimating homography...
evaluating homography...
nn_score: 0, nn2_score: 0, nn_score_cv: 0, nn2_score_cv: 0, time_my: 0, time_cv: 0.230272, time_bruteforce: 0, good_nn: 0.210258, good_ratio: 0, good_clusters: 0, good_ratio_and_clusters: 0.987342
[       OK ] MATCHING.Scale150 (1021 ms)
[ RUN      ] MATCHING.Scale175
testing sift detector/descriptor...
flann matching...
cv flann matching...
Get total 776 matches.
estimating homography...
evaluating homography...
nn_score: 0, nn2_score: 0, nn_score_cv: 0, nn2_score_cv: 0, time_my: 0, time_cv: 0.309857, time_bruteforce: 0, good_nn: 0.20643, good_ratio: 0, good_clusters: 0, good_ratio_and_clusters: 0.989691
[       OK ] MATCHING.Scale175 (1332 ms)
[ RUN      ] MATCHING.Scale200
testing sift detector/descriptor...
flann matching...
cv flann matching...
Get total 863 matches.
estimating homography...
evaluating homography...
nn_score: 0, nn2_score: 0, nn_score_cv: 0, nn2_score_cv: 0, time_my: 0, time_cv: 0.342911, time_bruteforce: 0, good_nn: 0.225057, good_ratio: 0, good_clusters: 0, good_ratio_and_clusters: 0.986095
[       OK ] MATCHING.Scale200 (1562 ms)
[ RUN      ] MATCHING.Rotate10Scale90
testing sift detector/descriptor...
flann matching...
cv flann matching...
Get total 639 matches.
estimating homography...
evaluating homography...
nn_score: 0, nn2_score: 0, nn_score_cv: 0, nn2_score_cv: 0, time_my: 0, time_cv: 0.095297, time_bruteforce: 0, good_nn: 0.177086, good_ratio: 0, good_clusters: 0, good_ratio_and_clusters: 0.99061
[       OK ] MATCHING.Rotate10Scale90 (543 ms)
[ RUN      ] MATCHING.Rotate30Scale75
testing sift detector/descriptor...
flann matching...
cv flann matching...
Get total 336 matches.
estimating homography...
evaluating homography...
nn_score: 0, nn2_score: 0, nn_score_cv: 0, nn2_score_cv: 0, time_my: 1e-06, time_cv: 0.076478, time_bruteforce: 0, good_nn: 0.119929, good_ratio: 0, good_clusters: 0, good_ratio_and_clusters: 0.964286
[       OK ] MATCHING.Rotate30Scale75 (429 ms)
[----------] 18 tests from MATCHING (16076 ms total)

[----------] 2 tests from STITCHING
[ RUN      ] STITCHING.SimplePanorama
[       OK ] STITCHING.SimplePanorama (0 ms)
[ RUN      ] STITCHING.Orthophoto
[       OK ] STITCHING.Orthophoto (0 ms)
[----------] 2 tests from STITCHING (0 ms total)

[----------] Global test environment tear-down
[==========] 20 tests from 2 test suites ran. (16076 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