| 1 |
import pycolmap |
| 2 |
|
| 3 |
|
| 4 |
def test_feature_matcher_type_enum(): |
| 5 |
assert pycolmap.FeatureMatcherType.UNDEFINED is not None |
| 6 |
assert pycolmap.FeatureMatcherType.SIFT_BRUTEFORCE is not None |
| 7 |
|
| 8 |
|
| 9 |
def test_sift_matching_options_default_init(): |
| 10 |
options = pycolmap.SiftMatchingOptions() |
| 11 |
assert options is not None |
| 12 |
|
| 13 |
|
| 14 |
def test_sift_matching_options_check(): |
| 15 |
options = pycolmap.SiftMatchingOptions() |
| 16 |
result = options.check() |
| 17 |
assert isinstance(result, bool) |
| 18 |
assert result is True |
| 19 |
|
| 20 |
|
| 21 |
def test_feature_matching_options_default_init(): |
| 22 |
options = pycolmap.FeatureMatchingOptions() |
| 23 |
assert options is not None |
| 24 |
|
| 25 |
|
| 26 |
def test_feature_matching_options_type_readwrite(): |
| 27 |
options = pycolmap.FeatureMatchingOptions() |
| 28 |
options.type = pycolmap.FeatureMatcherType.SIFT_BRUTEFORCE |
| 29 |
assert options.type == pycolmap.FeatureMatcherType.SIFT_BRUTEFORCE |
| 30 |
|
| 31 |
|
| 32 |
def test_feature_matching_options_num_threads_readwrite(): |
| 33 |
options = pycolmap.FeatureMatchingOptions() |
| 34 |
options.num_threads = 4 |
| 35 |
assert options.num_threads == 4 |
| 36 |
|
| 37 |
|
| 38 |
def test_feature_matching_options_use_gpu_readwrite(): |
| 39 |
options = pycolmap.FeatureMatchingOptions() |
| 40 |
options.use_gpu = False |
| 41 |
assert options.use_gpu is False |
| 42 |
|
| 43 |
|
| 44 |
def test_feature_matching_options_max_num_matches_readwrite(): |
| 45 |
options = pycolmap.FeatureMatchingOptions() |
| 46 |
options.max_num_matches = 16384 |
| 47 |
assert options.max_num_matches == 16384 |
| 48 |
|
| 49 |
|
| 50 |
def test_feature_matching_options_guided_matching_readwrite(): |
| 51 |
options = pycolmap.FeatureMatchingOptions() |
| 52 |
options.guided_matching = True |
| 53 |
assert options.guided_matching is True |
| 54 |
options.guided_matching = False |
| 55 |
assert options.guided_matching is False |
| 56 |
|
| 57 |
|
| 58 |
def test_feature_matching_options_skip_geometric_verification_readwrite(): |
| 59 |
options = pycolmap.FeatureMatchingOptions() |
| 60 |
options.skip_geometric_verification = True |
| 61 |
assert options.skip_geometric_verification is True |
| 62 |
options.skip_geometric_verification = False |
| 63 |
assert options.skip_geometric_verification is False |
| 64 |
|
| 65 |
|
| 66 |
def test_feature_matching_options_check(): |
| 67 |
options = pycolmap.FeatureMatchingOptions() |
| 68 |
result = options.check() |
| 69 |
assert isinstance(result, bool) |
| 70 |
assert result is True |
| 71 |
|
| 72 |
|
| 73 |
def test_feature_matcher_create(): |
| 74 |
matcher = pycolmap.FeatureMatcher.create(device=pycolmap.Device.cpu) |
| 75 |
assert matcher is not None |