DIY image retrieval with spatial verification
Project description
Hands-on wide baseline tutorial
Summary description here.
We will create the wide baseline stereo mather and try it on various images with various features. There is also a a (naive) example of the spatial verification together with image retrieval. We will not build the components from scratch, instead will be using a ready packages, like kornia, pydegensac and OpenCV
Install
pip install local_feature_tutorial
How to use
%matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
from local_feature_tutorial.wbs import *
from local_feature_tutorial.visualization import *
from local_feature_tutorial.io import *
from local_feature_tutorial.datasets import *
import cv2
hard_images_to_match = 'http://cmp.felk.cvut.cz/~mishkdmy/wbs_illum.tgz'
fname = download_file(hard_images_to_match)
untar_to(fname, 'data/wbs')
wbs_img_fnames = get_all_images_in_subdirs('data/wbs')
print (wbs_img_fnames)
visualize_grid(wbs_img_fnames, (8,8))
['data/wbs/chimera_01.png', 'data/wbs/chimera_02.png', 'data/wbs/dh_01.png', 'data/wbs/dh_02.png', 'data/wbs/doll_theater1.jpeg', 'data/wbs/doll_theater2.jpeg', 'data/wbs/doll_theater3.jpeg', 'data/wbs/kn_church-2.jpg', 'data/wbs/kn_church-8.jpg', 'data/wbs/ministry_01.png', 'data/wbs/ministry_02.png', 'data/wbs/ministry_03.png', 'data/wbs/purkine-2.jpg', 'data/wbs/purkine-4.jpg']
sift_hardnet_matcher = TwoViewMatcher(detector=cv2.SIFT_create(8000), descriptor=HardNetDesc(),
matcher=SNNMMatcher(0.9), geom_verif=degensac_Verifier(0.5))
res = sift_hardnet_matcher.verify(wbs_img_fnames[7], wbs_img_fnames[8])
print (res.keys())
draw_matches(res['match_kpts1'], res['match_kpts2'],
wbs_img_fnames[7], wbs_img_fnames[8], color=(0,255,0), R=10)
dict_keys(['match_kpts1', 'match_kpts2', 'F', 'num_inl'])
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file local_feature_tutorial-0.0.3.tar.gz
.
File metadata
- Download URL: local_feature_tutorial-0.0.3.tar.gz
- Upload date:
- Size: 19.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0.post20200127 requests-toolbelt/0.9.1 tqdm/4.42.0 CPython/3.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 62d0be66672da33fe92d5fb2d8a3cef97ae515b775e42fb6bcc77023741fcd23 |
|
MD5 | 64d674a61171fff4bff6d46c948f3d4e |
|
BLAKE2b-256 | 9fcd6a06a96f8753fc22e9ff69683ad864eae2029b9d05c1561d8266755fba66 |
File details
Details for the file local_feature_tutorial-0.0.3-py3-none-any.whl
.
File metadata
- Download URL: local_feature_tutorial-0.0.3-py3-none-any.whl
- Upload date:
- Size: 19.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0.post20200127 requests-toolbelt/0.9.1 tqdm/4.42.0 CPython/3.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 66b6addd9659620f8d80fd31f520d160c38846475148e886c25fe8c807e14dfc |
|
MD5 | a1ba3b978216ee8c4c8c505c37f05220 |
|
BLAKE2b-256 | 37c1ed48ea7588aaadbd2464223168400020467e170b47e7080988bfb7430ab7 |