Filtering
A suite of common filtering utilities.
This module includes several functions for filtering depth maps.
This module contains the following functions:
conf_filter(depth_map, conf_map, device, min_conf)
- Filters a map by confidence values above a minimum threshold.geometric_filter(src_depth, src_cam, tgt_depth, tgt_cam, pix_th, depth_th)
- Computes a geometric filter based off of pixel and depth reprojection error.topk_filter(depth_map, conf_map, device, percent)
- Filters a map by the top percentage of confidence values.topk_strict_filter(depth_map, filter_prob, device, percent)
- Filters a map by the top percentage of confidence values.
conf_filter(depth_map, conf_map, device='cuda:0', min_conf=0.8)
Filters a map by confidence values above a minimum threshold.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
depth_map |
torch.Tensor
|
required | |
conf_map |
torch.Tensor
|
required | |
device |
str
|
'cuda:0'
|
|
min_conf |
float
|
0.8
|
Returns:
Name | Type | Description |
---|---|---|
filtered_map |
torch.Tensor
|
|
mask |
torch.Tensor
|
Source code in cvt/filtering.py
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
|
geometric_filter(src_depth, src_cam, tgt_depth, tgt_cam, pix_th=1.0, depth_th=0.01)
Computes a geometric filter based off of pixel and depth reprojection error.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
src_depth |
np.ndarray
|
required | |
src_cam |
np.ndarray
|
required | |
tgt_depth |
np.ndarray
|
required | |
tgt_depth |
np.ndarray
|
required | |
pix_th |
float
|
1.0
|
|
depth_th |
float
|
0.01
|
Returns:
Name | Type | Description |
---|---|---|
mask |
np.ndarray
|
|
depth_reprojected |
np.ndarray
|
|
coords_tgt |
np.ndarray
|
Source code in cvt/filtering.py
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 |
|
topk_filter(depth_map, conf_map, device='cuda:0', percent=0.3)
Filters a map by the top percentage of confidence values.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
depth_map |
np.ndarray
|
required | |
conf_map |
np.ndarray
|
required | |
device |
str
|
'cuda:0'
|
|
percent |
float
|
0.3
|
Returns:
Name | Type | Description |
---|---|---|
filtered_map |
np.ndarray
|
|
mask |
np.ndarray
|
Source code in cvt/filtering.py
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 |
|
topk_strict_filter(depth_map, filter_prob, device='cuda:0', percent=0.3)
Filters a map by the top percentage of confidence values.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
depth_map |
np.ndarray
|
required | |
filter_prob |
np.ndarray
|
required | |
device |
str
|
'cuda:0'
|
|
percent |
float
|
0.3
|
Returns:
Name | Type | Description |
---|---|---|
filtered_map |
np.ndarray
|
|
mask |
np.ndarray
|
Source code in cvt/filtering.py
104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 |
|