Repository navigation
Conversation
…eir content Layer > Align > Auto-Align Layers, and Auto-Align in the Move bar's Align panel, take two or more selected pixel layers and line each one up over the active layer. A match that only shifts a layer moves it by whole pixels, as Align does, so a tilt-shift or tripod series isn't resampled; any other match distorts the layer into place, as a Cmd-drag distortion does. One undo step. Phase correlation finds how far apart two frames are, however little they overlap, and Vision then refines the match over just the part they share. Vision on its own misses frames that overlap by half, and answers with full confidence even for a flat gray, so each candidate is checked against the pixels (the correlation of their brightness, which holds across exposures) and the best is kept. A perspective is used only when it shares a third of the layer and clearly beats a shift; one fitted to a narrow overlap goes astray beyond it. Layers nothing matches are named in an alert and left where they were. Refs robbietilton#316.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
For #316, the alignment half: no blending or stitching into one layer.
What it does
distort(at:). That was private in Distort.swift and is now internal; nothing else in it changes.How it matches (
AutoAlign.swift)Vision alone wasn't enough. On two real 1000 px frames that overlap by 45%,
VNHomographicImageRegistrationRequestwas far off, andVNTranslationalImageRegistrationRequestreturned (-186, 728) against a true offset of about (550, 30). Both of them answer with full confidence for a flat gray image too. Vision also registers images of the same size only. So the match is built in three steps:Each layer's own pixels are compared, not the layers drawn onto the canvas, because their empty surroundings would look like an edge to match. The result is mapped through both layers' placements, flips included. On the real frames the whole match takes about 0.15 s.
Testing
AutoAlignTests:CGImage, so no resampling.CompositorTestson macOS 27: 886 pass and 1 fails, theExternalChangeTestsfile-event timeout (about 106 s), as on Perspective Crop: the Crop tool's Perspective switch straightens what four corners enclose #324. The sixExternalChangeTestspass on their own.🤖 Generated with Claude Code
https://claude.ai/code/session_01WC9aF7W8inTF7p9LZbNXRe