ThresholdImage_Dynamic
Thresholds an image relatively to some value calculated in a local rectangular neighbourhood.
Applications:Image binarization when the illumination is uneven.
Syntax
C++
Python
def ThresholdImage_Dynamic( inImage: Image, inRadiusX: int, outMonoImage: Image, /, *, inRoi: Region | None = None, inSourceRoi: Region | None = None, inReferenceMethod: ThresholdDynamicReferenceMethod = ThresholdDynamicReferenceMethod.Mean, inKernel: KernelShape = KernelShape.Box, inRadiusY: int | None = None, inMinRelativeValue: float | None = 0.0, inMaxRelativeValue: float | None = None, inFuzziness: float = 0.0, diagBaseImage: Image | None = None ) -> None
Parameters
| Name | Type | Range | Default | Description | |
|---|---|---|---|---|---|
![]() |
inImage | Image | Input image | ||
![]() |
inRoi | Region | None | None | Region in which pixels are written | |
![]() |
inSourceRoi | Region | None | None | Region from which pixels are read | |
![]() |
inReferenceMethod | ThresholdDynamicReferenceMethod | ThresholdDynamicReferenceMethod.Mean | Specifies how the local threshold value will be calculated (see SmoothImage filter family) | |
![]() |
inKernel | KernelShape | KernelShape.Box | Kernel shape. | |
![]() |
inRadiusX | int | 0 - 65535 | Horizontal radius of local neighbourhood. | |
![]() |
inRadiusY | int | None | 0 - 65535 | None | Vertical radius of local neighbourhood (Auto = inRadiusX) |
![]() |
inMinRelativeValue | float | None | 0.0 | Minimum relative value of a pixel that is considered foreground (Auto = -INF) | |
![]() |
inMaxRelativeValue | float | None | None | Maximum relative value of a pixel that is considered foreground (Auto = +INF) | |
![]() |
inFuzziness | float | 0.0 - ![]() |
0.0 | A tolerance for inMin/MaxRelativeValue that results in intermediate output values. Clamped on half of pixel max value (e.g. max fuzziness for uint8 image is 128). |
![]() |
outMonoImage | Image | |||
![]() |
diagBaseImage | Image | None | None | Diagnostic threshold values. |
Hardware Acceleration
This operation is optimized for SSE2 technology for pixels of type: 1xUINT8.




