Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement function to align all images of a stack #417

Open
opatiny opened this issue Dec 15, 2023 · 9 comments
Open

Implement function to align all images of a stack #417

opatiny opened this issue Dec 15, 2023 · 9 comments
Assignees
Labels
stacks Issues relative to the implementation of the `Stack` class

Comments

@opatiny
Copy link
Contributor

opatiny commented Dec 15, 2023

  • we should probably implement the smartAlign algorithm that was developed in profid-padif-rework in image-js-ts
  • align all images
  • crop all images in order to have the same dimension of all the images once aligned
@opatiny opatiny self-assigned this Dec 15, 2023
@opatiny opatiny added the stacks Issues relative to the implementation of the `Stack` class label Dec 15, 2023
@opatiny
Copy link
Contributor Author

opatiny commented Dec 15, 2023

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

@opatiny
Copy link
Contributor Author

opatiny commented Dec 15, 2023

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
Copy link
Contributor Author

opatiny commented Dec 22, 2023

  • 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 translations property.
  • All images are aligned on the first image of the stack? -> to be discussed

@targos
Copy link
Member

targos commented Dec 22, 2023

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
Copy link
Contributor Author

opatiny commented Dec 22, 2023

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
Copy link
Member

targos commented Dec 22, 2023

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

@opatiny
Copy link
Contributor Author

opatiny commented Dec 22, 2023

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

@targos
Copy link
Member

targos commented Dec 22, 2023

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
Copy link
Contributor Author

opatiny commented Dec 22, 2023

Wdyt @lpatiny ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stacks Issues relative to the implementation of the `Stack` class
Projects
None yet
Development

No branches or pull requests

2 participants