filtering module¶
Module for applying filters to image.
GaussianFilter(in_dem, sigma=1, out_file=None)
¶
Applies a Gaussian filter to an image.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
in_dem |
str
|
File path to the input image. |
required |
sigma |
int
|
Standard deviation. Defaults to 1. |
1
|
out_file |
str
|
File path to the output image. Defaults to None. |
None
|
Returns:
Type | Description |
---|---|
np.array: The numpy array containing the filtered image. |
Source code in lidar/filtering.py
92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 |
|
MeanFilter(in_dem, kernel_size=3, out_file=None)
¶
Applies a mean filter to an image.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
in_dem |
str
|
File path to the input image. |
required |
kernel_size |
int
|
The size of the moving window. Defaults to 3. |
3
|
out_file |
str
|
File path to the output image. Defaults to None. |
None
|
Returns:
Type | Description |
---|---|
np.array: The numpy array containing the filtered image. |
Source code in lidar/filtering.py
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 58 59 |
|
MedianFilter(in_dem, kernel_size=3, out_file=None)
¶
Applies a median filter to an image.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
in_dem |
str
|
File path to the input image. |
required |
kernel_size |
int
|
The size of the moving window. Defaults to 3. |
3
|
out_file |
str
|
File path to the output image. Defaults to None. |
None
|
Returns:
Type | Description |
---|---|
np.array: The numpy array containing the filtered image. |
Source code in lidar/filtering.py
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 |
|
np2rdarray(in_array, no_data, projection, geotransform)
¶
Converts an numpy array to rdarray.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
in_array |
array
|
The input numpy array. |
required |
no_data |
float
|
The no_data value of the array. |
required |
projection |
str
|
The projection of the image. |
required |
geotransform |
str
|
The geotransform of the image. |
required |
Returns:
Name | Type | Description |
---|---|---|
object |
The richDEM array. |
Source code in lidar/filtering.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
|