v1
apply_thresholding(image, threshold_type, thresh_value, max_value)
¶
Applies the specified thresholding to the image.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
image |
ndarray
|
Input image in grayscale. |
required |
threshold_type |
str
|
Type of thresholding ('binary', 'binary_inv', 'trunc', 'tozero', 'tozero_inv', 'adaptive_mean', 'adaptive_gaussian', 'otsu'). |
required |
thresh_value |
int
|
Threshold value. |
required |
max_value |
int
|
Maximum value to use with the THRESH_BINARY and THRESH_BINARY_INV thresholding types. |
required |
Returns:
Type | Description |
---|---|
ndarray
|
np.ndarray: Image with thresholding applied. |
Source code in inference/core/workflows/core_steps/classical_cv/threshold/v1.py
130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 |
|