You are here: Start » AVL.NET » AVL.ThresholdToRegion_RGB(AvlNet.Image, AvlNet.Region, int?, int?, int?, int?, int?, int?, AvlNet.Region)
AVL.ThresholdToRegion_RGB(AvlNet.Image, AvlNet.Region, int?, int?, int?, int?, int?, int?, AvlNet.Region)
Creates a region containing image pixels which belongs to the specified range for each individual pixel component.
| Namespace: | AvlNet |
|---|---|
| Assembly: | AVL.NET.dll |
Syntax
public static void ThresholdToRegion_RGB( AvlNet.Image inRgbImage, AvlNet.Region inRoi, int? inMinRed, int? inMaxRed, int? inMinGreen, int? inMaxGreen, int? inMinBlue, int? inMaxBlue, out AvlNet.Region outRegion )
Parameters
- inRgbImage
- Type: AvlNet.Image
Input image, usually in the RGB color space - inRoi
- Type: AvlNet.Region
Region of interest, or null. - inMinRed
- Type: System.Nullable<System.Int32>
Minimum for the first pixel component, usually Red (Auto = -INF), or null. - inMaxRed
- Type: System.Nullable<System.Int32>
Maximum for the first pixel component, usually Red (Auto = +INF), or null. - inMinGreen
- Type: System.Nullable<System.Int32>
Minimum for the second pixel component, usually Green (Auto = -INF), or null. - inMaxGreen
- Type: System.Nullable<System.Int32>
Maximum for the second pixel component, usually Green (Auto = +INF), or null. - inMinBlue
- Type: System.Nullable<System.Int32>
Minimum for the third pixel component, usually Blue (Auto = -INF), or null. - inMaxBlue
- Type: System.Nullable<System.Int32>
Maximum for the third pixel component, usually Blue (Auto = +INF), or null. - outRegion
- Type: AvlNet.Region
Output region
Description
The operation is a cousin of ThresholdImage_RGB yet it computes a region instead of an image. The three-channel inRgbImage is considered to be encoded using RGB color representation. The resulting region contains only those pixels of the input image, which meets all of the following conditions:
- Intensity of the "red" channel is in range (inMinRed, inMaxRed).
- Intensity of the "green" channel is in range (inMinGreen, inMaxGreen).
- Intensity of the "blue" channel is in range (inMinBlue, inMaxBlue).
If any of the parameters inMinRed, inMinGreen, inMinBlue is not set, it is assumed to be -infinity.
If any of the parameters inMaxRed, inMaxGreen, inMaxBlue is not set, it is assumed to be infinity.
Examples
![]() |
![]() |
ThresholdToRegion_RGB performed on the sample image with inMinRed = 120.0, inMaxGreen = 100.0, inMaxBlue = 100.0.
Hardware Acceleration
This operation supports automatic parallelization for multicore and multiprocessor systems.
Hardware acceleration settings may be manipulated with Settings class.
Errors
| Error type | Description |
|---|---|
| DomainError | Not a 3-channel and 8-bit image in ThresholdToRegion_RGB. |


