Is it possible for rectify the imaging distortion using Image J?

Dear all,

I have two images, one being a normal one and the other being a distorted one. Is there a way to use Image J to rectify the distorted image based on the same landmarks in the normal one? The images are shown below:

Imaging distortion.tif (695.9 KB)

Fig. a on the left is a good image, while Fig. b is the distorted one because of the drift issue during the imaging. Is it possible to fix three points in both figures, e.g. A, B, C, and rectify the distortion in Fig.b based on Fig.a?

Your help is much appreciated. Thank you so much in advance :grinning:


Hello David -

Plugins > Landmarks > Name Landmarks and Register
from the Fiji / ImageJ menubar suit your use case?

Some further detail is here: Name Landmarks and Register.

Here is some general information about image registration using
ImageJ with descriptions of some other tools: Registration.

Thanks, mm

1 Like

Hello MM,

Thanks for your info and I feel it could work.
I will have a look and let you know.

Thank you so much.


Hi MM,

I tried the registration following the tutorial, but after the very last step, the image didn’t change.

An error message shows up in the console panel.

To note, if the two images (reference image and the distorted image) are of the same size (e.g. both are 2um*2um), some of the features are not overlapping as the distorted image is a little elongated vertically. If the two images have almost the same features, the image sizes would be different.

I also tried cropping the two images to make them have the same features but it didn’t work out either.

By any chance do you have some ideas about this?

Thank you.


Hello David -

The first line of the error message:

(Bit depths != 8 or 16 in TransformedImage.)

suggests to me that the plugin only supports 8-bit and 16-bit

I also note that the example images you included in your first
post are RGB images, so maybe the plugin won’t work on
them (but unhelpfully throws an error late, rather than warning
you early).

If your original images are RGB, could you try converting them
to 8-bit grayscale (Image > Type > 8-bit), and then running
the registration tool?

If that works, but you really need to perform the registration with
your original RGB images, I suppose you could convert them
to separate 8-bit images that represent the RGB channels
(Image > Type > RGB Stack;
Image > Stacks > Stack to Images), register the R, G,
and B channels separately, and then recombine them
(Image > Stacks > Images to Stack;
Image > Type > RGB Color). It would be a bit of a nuisance,
but might be your best choice.

(As an aside, going forward could you post textual error
messages as text, rather than screenshots? That way they
can be copy-pasted and searched on.)

Thanks, mm

1 Like

Dear MM,

Thank you very much for your so detailed answer and also sorry about not posting them as pure text.

I tried again and it worked!

Thank you so much!!!

Have a good day!

Take care and stay safe~

Thank you.