| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 98e39b3 commit a9031fb
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -32,6 +32,14 @@ def __init__(self, num=0): | |||
| 32 | 32 | assert(isinstance(num, numbers.Number)) | |
| 33 | 33 | safe_call(backend.get().af_create_features(c_pointer(self.feat), c_dim_t(num))) | |
| 34 | 34 | ||
| 35 | + def __del__(self): | ||
| 36 | + """ | ||
| 37 | + Release features' memory | ||
| 38 | + """ | ||
| 39 | + if self.feat: | ||
| 40 | + backend.get().af_release_features(self.feat) | ||
| 41 | + self.feat = None | ||
| 42 | + | ||
| 35 | 43 | def num_features(self): | |
| 36 | 44 | """ | |
| 37 | 45 | Returns the number of features detected. | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -131,7 +131,7 @@ def orb(image, threshold=20.0, max_features=400, scale = 1.5, num_levels = 4, bl | |||
| 131 | 131 | """ | |
| 132 | 132 | feat = Features() | |
| 133 | 133 | desc = Array() | |
| 134 | - safe_call(backend.get().af_orb(c_pointer(feat.feat), c_pointer(desc.arr), | ||
| 134 | + safe_call(backend.get().af_orb(c_pointer(feat.feat), c_pointer(desc.arr), image.arr, | ||
| 135 | 135 | c_float_t(threshold), c_uint_t(max_features), | |
| 136 | 136 | c_float_t(scale), c_uint_t(num_levels), blur_image)) | |
| 137 | 137 | return feat, desc | |
@@ -391,9 +391,11 @@ def gloh(image, num_layers=3, contrast_threshold=0.04, edge_threshold=10.0, init | |||
| 391 | 391 | ||
| 392 | 392 | feat = Features() | |
| 393 | 393 | desc = Array() | |
| 394 | - safe_call(af_gloh(c_pointer(feat), c_pointer(desc), | ||
| 395 | - image.arr, num_layers, contrast_threshold, edge_threshold, | ||
| 396 | - initial_sigma, double_input, intensity_scale, feature_ratio)) | ||
| 394 | + safe_call(backend.get().af_gloh(c_pointer(feat.feat), c_pointer(desc.arr), | ||
| 395 | + image.arr, num_layers, c_float_t(contrast_threshold), | ||
| 396 | + c_float_t(edge_threshold), c_float_t(initial_sigma), | ||
| 397 | + double_input, c_float_t(intensity_scale), | ||
| 398 | + c_float_t(feature_ratio))) | ||
| 397 | 399 | ||
| 398 | 400 | return (feat, desc) | |
| 399 | 401 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments