Message Boards Message Boards


Avoid problem with the ImageAlign function?

Posted 6 months ago
1 Reply
2 Total Likes

Dear all,

I tried to register the movie posted below (compressed version here) using Mathematica but to no use. However I could manage to do the same very easily with another software (FIJI: ) with a plugin "StackReg" ( enter image description here

The strategy that I used for the registration was as follows with both softwares:

  1. Inverting (ColorNegate) the image

  2. Applying a Gaussian Blur of radius 10

  3. Thresholding the image to obtain a mask for the object

  4. Registering the binarized image (mask) and saving the transformation matrices

  5. Using the transformation matrices to obtain a registered version of the image.

Result obtained from FIJI/plugin :

enter image description here

The code for Mathematica breaks when I do the same:

enter image description here

Can anyone please help me figure out why ImageAlign is breaking down?

This is a simple problem and I expect that the ImageAlign function should not break down on such a petty case. I checked my masks and they seem to be fine. I gave the masks that I generated from Mathematica to FIJI/StackReg which can successfully align them and yield the transformation matrices in a .txt file. This brings me to the second question, is there a way to get the transformation matrix (alignment matrix) from ImageAlign. Because I need the transformation matrices after alignment in order to align the original movie.

Note: StackReg aligns all the images relative to the first frame.

Hi Ali,

I guess different images are not supposed to be aligned - and these images are in fact different, and if all background is cut out and just a single dot (cell?) is left, then the error message says it all: "The number 1 of correspondences found is not enough to align the images.": Any rotation is undefined, and I would not regard the animation obtained from FIJI/plugin as a solution.

Without test data I cannot try, but i think you would rather need ImageTransformation together with ComponentMeasurements[#,"Centroid"]& - as a first guess. Or maybe ImageFeatureTrack does the trick.

Regards -- Henrik

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract