You are here: Start » Function Reference » Computer Vision » Image Analysis » CheckPresence_Intensity

CheckPresence_Intensity
Header: | FIL.h |
---|---|
Namespace: | fil |
Module: | FoundationPro |
Verifies object presence by analysing pixel intensities in the specified region.
Applications: Quick and easy presence verification, e.g. for missing caps, screws, labels.
Syntax
void fil::CheckPresence_Intensity ( const fil::Image& inImage, const fil::ShapeRegion& inRoi, ftl::Optional<const fil::CoordinateSystem2D&> inRoiAlignment, ftl::Optional<float> inMinIntensity, ftl::Optional<float> inMaxIntensity, float inMinContrast, ftl::Optional<float> inMaxContrast, bool& outIsPresent, ftl::Optional<float&> outIntensity = ftl::NIL, ftl::Optional<float&> outContrast = ftl::NIL, ftl::Optional<fil::ShapeRegion&> outAlignedRoi = ftl::NIL )
Parameters
Name | Type | Range | Default | Description | |
---|---|---|---|---|---|
![]() |
inImage | const Image& | Input image | ||
![]() |
inRoi | const ShapeRegion& | 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 | |
![]() |
inMinIntensity | Optional<float> | NIL | Lowest acceptable value for the average pixel value | |
![]() |
inMaxIntensity | Optional<float> | NIL | Highest acceptable value for the average pixel value | |
![]() |
inMinContrast | float | 0.0 - ![]() |
Lowest acceptable value for the standard deviation of the pixel values | |
![]() |
inMaxContrast | Optional<float> | 0.0 - ![]() |
NIL | Highest acceptable value for the standard deviation of the pixel values |
![]() |
outIsPresent | bool& | Flag indicating whether the object is present or not | ||
![]() |
outIntensity | Optional<float&> | NIL | Average pixel value | |
![]() |
outContrast | Optional<float&> | NIL | Standard deviation of the pixel values | |
![]() |
outAlignedRoi | Optional<ShapeRegion&> | NIL | Input ROI after transformation (in the image coordinates) |
Optional Outputs
The computation of following outputs can be switched off by passing value ftl::NIL
to these parameters: outIntensity, outContrast, outAlignedRoi.
Read more about Optional Outputs.
Description
The filter computes basic statistics of the image pixels in selected ROI and checks if they fit the defined ranges. The used statistics are average and standard deviation of the pixel values.
Hints
- If the object location is variable, Pass an appropriate local coordinate system to inRoiAlignment.
- Define inRoi to specify the image location at which the object presence will be checked.
- Investigate the values that appear on outIntensity and outContrast outputs. With this information set inMinIntensity, inMaxIntensity, inMinContrast and inMaxContrast to values which are appropriate for correct objects.
- When creating data previews, use outAlignedRoi and NOT inRoi as only the former will be properly aligned to the object location.
Examples
![]() |
![]() |
CheckPresence_Intensity performed on sample image with inMinIntensity = 80. The foam is present in red rectangle.
Errors
List of possible exceptions:
Error type | Description |
---|---|
DomainError | Region exceeds an input image in CheckPresence_Intensity. |
See Also
- CheckPresence_PixelAmount – Verifies object presence by analysing the amount of pixels that meet the specified criteria.
- CheckPresence_EdgeAmount – Verifies object presence by analysing the amount of edges in the specified region.
- ImageAverage – Computes the average of the image pixel values.