CogImageSharpness Execute Method Cognex VisionPro 9.8 SR1
Calculate the sharpness of the given image in the given region.

Namespace: Cognex.VisionPro.ImageProcessing
Assembly: Cognex.VisionPro.ImageProcessing (in Cognex.VisionPro.ImageProcessing.dll) Version: 75.0.0.0
Syntax

public double Execute(
	CogImage8Grey inputImage,
	ICogRegion region
)

Return Value

Type: Double

The returned sharpness.

Exceptions

ExceptionCondition
CogOperatorNoInputImageException

inputImage is NULL.

CogImageNoPixelsException

inputImage is not allocated.

ArgumentException

Mode is AutoCorrelation and the height or width of inputImage is less than 3 pixels.

ArgumentException

Mode is AbsDiff and AbsDiffDistanceX or AbsDiffDistanceY like outside of inputImage.

Remarks

Calculates the sharpness of of the supplied inputImage within the supplied region.

If Mode is GradientEnergy, the image is processed using Gaussian smoothing before measuring sharpness.

The returned sharpness value is only valid with respect to other sharpness values computed using the current Mode and image content. You cannot compare sharpness scores generated using different methods or images.

See Also