image-js / image-js-typescript

Temporary repository to work on the migration of image-js to TypeScript
https://image-js.github.io/image-js-typescript/
MIT License
5 stars 5 forks source link

Implement function to align all images of a stack #417

Open opatiny opened 9 months ago

opatiny commented 9 months ago
opatiny commented 9 months ago

This would be the equivalent of the matchAndCrop function currently in image-js.

opatiny commented 9 months ago

We have to add a new property to stacks called

private readonly translations: Point[];

We'll divide the alignment into two different methods 1) align: modifies the translations property of the stack to have all the translations that have to be applied to the images to align them 2) cropCommonArea: creates a new stack with the cropped images (all the same size). The translations of the new stack are all (0,0).

opatiny commented 8 months ago
targos commented 8 months ago

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?

opatiny commented 8 months ago

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".

targos commented 8 months ago

If the mental model of it is a movie, "Stack" seems like the wrong name 😕

opatiny commented 8 months ago

Indeed, that is how I considered them in my head, but maybe it's not the best. How would you imagine the stacks?

targos commented 8 months ago

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.

opatiny commented 8 months ago

Wdyt @lpatiny ?