Auto Alignment
This function block aligns an input image to a provided reference image so that objects in both images match position and scale. Use it when you need the input image to share the same framing or registration as a reference for comparison, measurement, or further processing.
π₯ Inputs
Input Image The image that will be transformed to match the reference.
Reference Image The target image that defines the desired alignment (position, scale and perspective) for the input.
π€ Outputs
Aligned Image The resulting image after alignment. If alignment cannot be performed, this output will be empty or unchanged and an error message will be reported.
πΉοΈ Controls
No Controls This block has no additional widgets. Alignment is driven only by the provided inputs.
π― Features
Quiet, single-purpose alignment: feed two images and get an aligned result without extra configuration.
Automatic failure reporting: the block provides clear messages when alignment fails (for example when the reference cannot be matched).
Light-weight and easy to insert into any image processing chain where registration is required.
βοΈ Running mechanism
When both
Input ImageandReference Imageare provided, the block attempts to match the input to the reference and producesAligned Image.If alignment succeeds, the output contains the transformed image that matches the reference framing.
If alignment cannot be established, the block reports an error and does not produce a valid aligned image.
π Usage instructions
Provide a clear, well-lit
Reference Imagethat contains the same scene or object you expect in theInput Image.Connect the image you want to align to
Input Image.Run the scenario. The block will output
Aligned Imagewhen successful.If alignment fails, refine inputs (see troubleshooting) and try again.
π‘ Tips and Tricks
If your input and reference images contain extra background clutter or irrelevant regions, crop them first with
Image ROI SelectorImage ROIto focus alignment on the area of interest.If image sizes differ greatly, use
Image ResizerorImage Resizeto bring images to comparable dimensions before alignment.For low-detail or noisy images, improve contrast using
Contrast OptimizationorAuto Contrastand reduce noise usingDenoisingto increase alignment reliability.Visualize results with
Show Imageto confirm alignment interactively. UseImage LoggerorImage Writeto save aligned outputs for later review.When alignment is part of a pipeline (e.g., measurements or detection), run alignment before detectors like
Find ObjectorTemplate Matchto ensure consistent coordinates.When measuring between multiple regions, consider cropping aligned results with
Get ROIand then using measurement or analysis blocks.
π οΈ Troubleshooting
Alignment fails or produces a distorted result:
Ensure both images contain the same visible features and sufficient overlap.
Improve image contrast using
Contrast Optimizationor remove noise withDenoising.Crop to remove distracting background with
Image ROI Selectand retry.
No output produced:
Confirm both
Input ImageandReference Imageare connected and valid image types.Inspect error messages in the block UI and use
Show Imageto view inputs before alignment.
Use the above suggestions to combine this block effectively with other function blocks in your workflow for robust, repeatable image registration.
Last updated
Was this helpful?