modosaic.services.edge¶
modosaic.services.edge ¶
EdgeService ¶
Edge-map utilities used by cross-modality validators.
rgb_edge_map
staticmethod
¶
rgb_edge_map(rgb_uint8, q=0.9)
Compute a boolean edge map from an RGB uint8 image.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
rgb_uint8
|
ndarray
|
RGB image with shape |
required |
q
|
float
|
Quantile threshold applied to gradient magnitudes. |
0.9
|
Returns:
| Type | Description |
|---|---|
ndarray
|
Boolean edge map. |
Source code in modosaic/services/edge.py
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 | |
sobel_edge_map_float
staticmethod
¶
sobel_edge_map_float(img, blur_ksize=3, q=0.9, valid_mask=None)
Compute a boolean Sobel edge map from a scalar image.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
img
|
ndarray
|
Scalar image or dense map. |
required |
blur_ksize
|
int
|
Gaussian blur kernel size before Sobel filtering. |
3
|
q
|
float
|
Quantile threshold applied to gradient magnitudes. |
0.9
|
valid_mask
|
ndarray | None
|
Optional mask limiting where edges can be detected. |
None
|
Returns:
| Type | Description |
|---|---|
ndarray
|
Boolean edge map. |
Source code in modosaic/services/edge.py
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | |