Geometric Transforms

  • Geometric transformation moves selected pixels in an image, which is useful if a shape in an image is too large / small / distorted, to make point-to-point comparisons possible.

  • The selected area may be any shape, but the resulting image is always rectangular. Pixels in the destination image that have corresponding pixels that are outside the selected area are considered not relevant and are left black.

  • When the source coordinates for a destination pixel are not integer, an interpolation technique is required.

    • The nearest neighborhood method is the quickest - it uses the closest source pixel.

    • The bi-linear interpolation method is more accurate but slower - it uses a weighted average of the four neighboring source pixels.

Re-Alignment

The simplest way to realign two misaligned images is to accurately locate features in both images (landmarks or pivots, using pattern matching, point measurement or other) and realign one of the images so that these features are superimposed.

You can EasyImage::Register .NET Python an image by realigning one, two or three pivot points to reference positions. For best accuracy, the pivot points should be as far apart as possible.

  • A single pivot point transform is a simple translation. If interpolation bits are used, sub-pixel translation is achieved.

  • Two pivot points use a combination of translation, rotation and optionally scaling. If scaling is not allowed, the second pivot point may not be matched exactly. Scaling should not normally be used unless it corresponds to a change of lens magnification or viewing distance.

  • Three pivot points use a combination of translation, rotation, shear correction and optionally scaling. A shear effect can arise when acquiring images with a misaligned line-scan camera.

Mirroring

This destructive feature modifies the source image to create a mirror image:

Resizing

If you need to resize an image, you can use the method EasyImage::Resize .NET Python, which resizes your image to the size of the destination image.

Hint

It is always faster than using the method EasyImage::ScaleRotate .NET Python.

Translation, Scaling and Rotation

To apply a transformation involving a scaling, rotation and translation, you can use EasyImage::ScaleRotate .NET Python. In one call, it performs:

  • Image translation: you provide the position coordinates of a pivot-point in the source image and a corresponding pivot point in the destination image.

  • Image scaling: you provide scaling factor values for X- and Y-axis.

  • Image rotation: you provide a rotation angle value.

For resampling, the nearest neighbor rule or bilinear interpolation with 4 or 8 bits of accuracy is used. The size of the destination image is arbitrary.

Example of nearest interpolation.
Zoom on the edges.
Example of linear interpolation.
Zoom on the edges.
Example of cubic interpolation.
Zoom on the edges.

Shrink

EasyImage::Shrink .NET Python resizes an image to be smaller, applying pre-filtering to avoid aliasing.

LUT-Based Unwarping

See Also

Resize Code Snippets

Easy to understand, ready to copy code snippets to use when resizing images.

Performing a Resize Operation
Warp Code Snippets

Easy to understand, ready to copy code snippets to use when (un)warpping images.

Warping