Back to FabImage Library website
You are here: Start » Function Reference » Computer Vision » Image Analysis » CheckPresence_PixelAmount_Deprecated

CheckPresence_PixelAmount_Deprecated
Header: | FIL.h |
---|---|
Namespace: | fil |
Module: | FoundationPro |
Verifies object presence by analysing the amount of pixels that meet the specified criteria.
Applications: Quick and easy presence verification, e.g. for missing caps, screws, labels.
Syntax
void fil::CheckPresence_PixelAmount_Deprecated ( const fil::Image& inImage, const fil::ShapeRegionDeprecated& inRoi, ftl::Optional<const fil::CoordinateSystem2D&> inRoiAlignment, fil::HSxColorModel::Type inColorModel, int inBeginHue, int inEndHue, int inMinSaturation, ftl::Optional<int> inMaxSaturation, ftl::Optional<float> inMinBrightness, ftl::Optional<float> inMaxBrightness, float inMinAmount, float inMaxAmount, bool& outIsPresent, ftl::Optional<float&> outAmount = ftl::NIL, ftl::Optional<fil::Region&> outForeground = ftl::NIL, ftl::Optional<fil::ShapeRegionDeprecated&> outAlignedRoi = ftl::NIL, fil::Image& diagHsxImage )
Parameters
Name | Type | Range | Default | Description | |
---|---|---|---|---|---|
![]() |
inImage | const Image& | Input image | ||
![]() |
inRoi | const ShapeRegionDeprecated& | Location at which object presence is being checked | ||
![]() |
inRoiAlignment | Optional<const CoordinateSystem2D&> | NIL | Adjusts the region of interest to the position of the inspected object | |
![]() |
inColorModel | HSxColorModel::Type | Selected color model | ||
![]() |
inBeginHue | int | 0 - 255 | 0 | Begin of the range of acceptable hue |
![]() |
inEndHue | int | 0 - 255 | 255 | End of the range of acceptable hue |
![]() |
inMinSaturation | int | 0 - 255 | 128 | Lowest acceptable saturation |
![]() |
inMaxSaturation | Optional<int> | 0 - 255 | NIL | Highest acceptable saturation |
![]() |
inMinBrightness | Optional<float> | 0.0 - ![]() |
128.0f | Lowest acceptable brightness |
![]() |
inMaxBrightness | Optional<float> | 0.0 - ![]() |
NIL | Highest acceptable brightness |
![]() |
inMinAmount | float | 0.0 - 1.0 | 0.5f | Lowest acceptable fraction of pixels meeting the criteria |
![]() |
inMaxAmount | float | 0.0 - 1.0 | 1.0f | Highest acceptable fraction of pixels meeting the criteria |
![]() |
outIsPresent | bool& | Flag indicating whether the object is present or not | ||
![]() |
outAmount | Optional<float&> | NIL | Fraction of pixels meeting the criteria | |
![]() |
outForeground | Optional<Region&> | NIL | Region of pixels meeting the criteria | |
![]() |
outAlignedRoi | Optional<ShapeRegionDeprecated&> | NIL | Input ROI after transformation (in the image coordinates) | |
![]() |
diagHsxImage | Image& | Image represented in chosen color model |
Requirements
For input inImage only pixel formats are supported: 3⨯uint8, 1⨯uint8, 1⨯int8, 1⨯uint16, 1⨯int16, 1⨯int32, 1⨯real.
Read more about pixel formats in Image documentation.
Optional Outputs
The computation of following outputs can be switched off by passing value ftl::NIL
to these parameters: outAmount, outForeground, outAlignedRoi.
Read more about Optional Outputs.
Errors
List of possible exceptions:
Error type | Description |
---|---|
DomainError | Not supported inImage pixel format in CheckPresence_PixelAmount_Deprecated. Supported formats: 3xUInt8, 1xUInt8, 1xInt8, 1xUInt16, 1xInt16, 1xInt32, 1xReal. |