Implement function to align all images of a stack
- we should probably implement the
smartAlignalgorithm that was developed in profid-padif-rework inimage-js-ts - align all images
- crop all images in order to have the same dimension of all the images once aligned
This would be the equivalent of the matchAndCrop function currently in image-js.
We have to add a new property to stacks called
private readonly translations: Point[];
We'll divide the alignment into two different methods
-
align: modifies the translations property of the stack to have all the translations that have to be applied to the images to align them -
cropCommonArea: creates a new stack with the cropped images (all the same size). The translations of the new stack are all (0,0).
- Align of a stack will not be based on
smartAlign! - The align method should work on images with different sizes.
- The user should specify a maximal x and y displacement.
- The pixels that don't overlap are ignored
- For each translation, the similarity is computed and the position with the minimal similarity is written in the
translationsproperty. - All images are aligned on the first image of the stack? -> to be discussed
Related: if we imagine the stack in 3D, is the first image (images[0]) at the bottom or at the top?
In other words, if we look at the stack from above, which image do we see?
Related: if we imagine the stack in 3D, is the first image (
images[0]) at the bottom or at the top? In other words, if we look at the stack from above, which image do we see?
I feel like the order of the images should be the order in which you would show them if they were part of a movie. In other words, if you loop on the images, it should be the order in which they appear in the "animation".
If the mental model of it is a movie, "Stack" seems like the wrong name 😕
Indeed, that is how I considered them in my head, but maybe it's not the best. How would you imagine the stacks?
I don't know, hence my question. In other image processing software, stacks do not represent videos. They are used to combine multiple images, for example to enhance quality and contrast in astrophotography.
Wdyt @lpatiny ?