EasyImage::AutoThreshold
Returns a suitable threshold value for a gray-level image binarization The process of classifying the pixels in an image as belonging to the object of interest (foreground pixels), or not (background pixels). This is a basic technique of image segmentation..
Namespace: Euresys::Open_eVision
License(s): EasyImage or EasyOCV
[C++]
static EBW8
AutoThreshold(
const EROIBW8
* sourceImage,
EThresholdMode
thresholdMode,
float relativeThresholdMode
)
static EBW16
AutoThreshold(
const EROIBW16
* sourceImage,
EThresholdMode
thresholdMode,
float relativeThresholdMode
)
static EBW8
AutoThreshold(
const EROIBW8
* sourceImage,
const EROIBW8
* mask,
EThresholdMode
thresholdMode,
float relativeThresholdMode
)
static EBW16
AutoThreshold(
const EROIBW16
* sourceImage,
const EROIBW8
* mask,
EThresholdMode
thresholdMode,
float relativeThresholdMode
)
static EBW8
AutoThreshold(
const EROIBW8
* sourceImage,
const ERegion
& region,
EThresholdMode
thresholdMode,
float relativeThresholdMode
)
static EBW16
AutoThreshold(
const EROIBW16
* sourceImage,
const ERegion
& region,
EThresholdMode
thresholdMode,
float relativeThresholdMode
)
Parameters
sourceImage
Pointer to the source image/ROI.
thresholdMode
The thresholding mode, as defined by the enumeration EThresholdMode
. To use absolute thresholding, use directly the threshold value instead.
relativeThresholdMode
Fraction of the image pixels that will be set below the threshold. Only used when the threshold value is EThresholdMode.Relative
(by default, relativeThresholdMode = 0.5
).
mask
Pointer to a mask to apply the function only on a particular region in the image. Note: the mask must have the same size as the source image.
region
An ERegion object In a general content, the term object should be understood with the meaning of a class instance. In EasyObject, an object is a maximally-sized area of adjacent connected pixels belonging to the layer foreground. to apply the function only on a particular region in the image.
Remarks
Several modes are available: absolute (the threshold value is given readily in the thresholdMode
parameter), relative (the threshold value is computed to obtain a desired fraction of the image pixels) or automatic (using three different criteria).
It is possible that, in the automatic or relative thresholding Thresholding in such a way that a known fraction of the image pixels lie above the threshold. modes, the computed threshold exceeds the dynamic range of the return type. In this case, the value is clipped to the maximum value that is representable in the return type.
EasyImage.AutoThreshold
Returns a suitable threshold value for a gray-level image binarization.
Namespace: Euresys.Open_eVision
License(s): EasyImage or EasyOCV
[C#]
static EBW8
AutoThreshold(
EROIBW8
sourceImage,
EThresholdMode
thresholdMode,
float relativeThresholdMode
)
static EBW16
AutoThreshold(
EROIBW16
sourceImage,
EThresholdMode
thresholdMode,
float relativeThresholdMode
)
static EBW8
AutoThreshold(
EROIBW8
sourceImage,
EROIBW8
mask,
EThresholdMode
thresholdMode,
float relativeThresholdMode
)
static EBW16
AutoThreshold(
EROIBW16
sourceImage,
EROIBW8
mask,
EThresholdMode
thresholdMode,
float relativeThresholdMode
)
static EBW8
AutoThreshold(
EROIBW8
sourceImage,
ERegion
region,
EThresholdMode
thresholdMode,
float relativeThresholdMode
)
static EBW16
AutoThreshold(
EROIBW16
sourceImage,
ERegion
region,
EThresholdMode
thresholdMode,
float relativeThresholdMode
)
Parameters
sourceImage
Pointer to the source image/ROI.
thresholdMode
The thresholding mode, as defined by the enumeration EThresholdMode
. To use absolute thresholding, use directly the threshold value instead.
relativeThresholdMode
Fraction of the image pixels that will be set below the threshold. Only used when the threshold value is EThresholdMode.Relative
(by default, relativeThresholdMode = 0.5
).
mask
Pointer to a mask to apply the function only on a particular region in the image. Note: the mask must have the same size as the source image.
region
An ERegion object to apply the function only on a particular region in the image.
Remarks
Several modes are available: absolute (the threshold value is given readily in the thresholdMode
parameter), relative (the threshold value is computed to obtain a desired fraction of the image pixels) or automatic (using three different criteria).
It is possible that, in the automatic or relative thresholding modes, the computed threshold exceeds the dynamic range of the return type. In this case, the value is clipped to the maximum value that is representable in the return type.
EasyImage.AutoThreshold
Returns a suitable threshold value for a gray-level image binarization.
Module: open_evision
License(s): EasyImage or EasyOCV
[Python]
@staticmethod
AutoThreshold(
sourceImage: EROIBW8
thresholdMode: EThresholdMode
relativeThresholdMode: float
) -> EBW8
@staticmethod
AutoThreshold(
sourceImage: EROIBW8
thresholdMode: EThresholdMode
) -> EBW8
@staticmethod
AutoThreshold(
sourceImage: EROIBW16
thresholdMode: EThresholdMode
relativeThresholdMode: float
) -> EBW16
@staticmethod
AutoThreshold(
sourceImage: EROIBW16
thresholdMode: EThresholdMode
) -> EBW16
@staticmethod
AutoThreshold(
sourceImage: EROIBW8
mask: EROIBW8
thresholdMode: EThresholdMode
relativeThresholdMode: float
) -> EBW8
@staticmethod
AutoThreshold(
sourceImage: EROIBW8
mask: EROIBW8
thresholdMode: EThresholdMode
) -> EBW8
@staticmethod
AutoThreshold(
sourceImage: EROIBW16
mask: EROIBW8
thresholdMode: EThresholdMode
relativeThresholdMode: float
) -> EBW16
@staticmethod
AutoThreshold(
sourceImage: EROIBW16
mask: EROIBW8
thresholdMode: EThresholdMode
) -> EBW16
@staticmethod
AutoThreshold(
sourceImage: EROIBW8
region: ERegion
thresholdMode: EThresholdMode
relativeThresholdMode: float
) -> EBW8
@staticmethod
AutoThreshold(
sourceImage: EROIBW8
region: ERegion
thresholdMode: EThresholdMode
) -> EBW8
@staticmethod
AutoThreshold(
sourceImage: EROIBW16
region: ERegion
thresholdMode: EThresholdMode
relativeThresholdMode: float
) -> EBW16
@staticmethod
AutoThreshold(
sourceImage: EROIBW16
region: ERegion
thresholdMode: EThresholdMode
) -> EBW16
Parameters
sourceImage
Pointer to the source image/ROI.
thresholdMode
The thresholding mode, as defined by the enumeration EThresholdMode
. To use absolute thresholding, use directly the threshold value instead.
relativeThresholdMode
Fraction of the image pixels that will be set below the threshold. Only used when the threshold value is EThresholdMode.Relative
(by default, relativeThresholdMode = 0.5
).
mask
Pointer to a mask to apply the function only on a particular region in the image. Note: the mask must have the same size as the source image.
region
An ERegion object to apply the function only on a particular region in the image.
Remarks
Several modes are available: absolute (the threshold value is given readily in the thresholdMode
parameter), relative (the threshold value is computed to obtain a desired fraction of the image pixels) or automatic (using three different criteria).
It is possible that, in the automatic or relative thresholding modes, the computed threshold exceeds the dynamic range of the return type. In this case, the value is clipped to the maximum value that is representable in the return type.