CogSurfaceFXTool Region Property Cognex VisionPro
Gets or sets the region. The region bounding box specifies the portion of each image to be processed. The output image size is based on the region bounding box size.

Namespace: Cognex.VisionPro.SurfaceFX
Assembly: Cognex.VisionPro.SurfaceFX (in Cognex.VisionPro.SurfaceFX.dll) Version: 65.1.0.0
Syntax

public ICogRegion Region { get; set; }

Property Value

Type: ICogRegion
The search region. Default value is null.
Events

Event TypeReason
ICogChangedEvent Changed Fires when this property changes. The following state flags may be affected:
Exceptions

ExceptionCondition
ObjectDisposedException If the object has been disposed.
Remarks

SurfaceFX also does not try to guess which of the newly - aligned pixels the user expects to see in the output image. It requires the user to provide a region – specified in the shared coordinate space – that defines the size, shape, and location of the desired output image. SurfaceFX insists that the pixel - aligned bounding box of this region must fall completely on the pixels of each input image. If the bounding box of the region falls off the edge of any input image, an error will be returned.

To ensure that the region's bounding box is the same size on all images (and is not affected by tiny floating-point round off errors) we do the following:

  • Compute the whole - pixel size of the bounding box on all input images.
  • Determine the smallest width of the bounding boxes, and the smallest height.
  • Create a whole - pixel rectangle using the smallest width and height.
  • Transfer the integer dimensions of this rectangle to the other three input images, using the whole - pixel alignment computed during the alignment phase, as described above.

If the user knows that there is no motion in their application, they need not provide a region at all. SurfaceFX will simply assume that the desired region is the full size of the first input image and has a SelectedSpaceName of ".". This will give the desired result for our most common users : users that supply input images with the same size and the same SelectedSpaceName. It will also(correctly) result in a runtime error if there is any fixtured motion between the images.

See Also