Re: [Gimp-user] image alignment/registration
- From: Casey Connor <gimp-user-list caseyconnor org>
- To: "gimp-user-list gnome org" <gimp-user-list gnome org>
- Subject: Re: [Gimp-user] image alignment/registration
- Date: Sun, 26 Mar 2017 15:45:29 -0700
Ok -- I believe PS is beating align_image_stack because the picture
seems to have been taken with a very wide lens (i.e. short focal length)
from close up... as a result, there is a lot of barrel distortion, and
in addition there is a lot of camera movement between frames, so the
result is that the image distorts differently from frame to frame and
align_image_stack is not able to do it automatically. Meaning, when you
turn the camera that much, it "bends" the contents of the image in
various different ways that make the images much harder to align. PS
might be able to automatically correct for that distortion, but
align_image_stack seems to struggle with it -- I get the same bad
alignment results you did, but read on for more ideas:
If you can use a longer focal length and stand farther away, and also
hold the camera more still, I think it will work better (and have less
barrel distortion as well.) Your PS screenshot also looks like there was
some kind of contrast or something applied (by PS, I assume? -- maybe
related to the layer overlay mode when you stack the frames? -- or maybe
PS is just doing a better job!)
But note this: you don't have to, and probably shouldn't, use the manual
layer stacking method. That creates a simple averaging of the pixels,
and it's probably pretty tedious to set up. There is another utility you
can use to create the median, instead of the average (aka mean), of the
image, which usually looks better. After I do align_image_stack, I use
gmic <http://gmic.eu/> to take the median of the files. The command line
looks like this (where test0001.tif etc are the images after alignment):
gmic -median_files test\*.tif -o output.tif
(you have to use "\*" with wildcards in gmic for whatever reason.)
Then I take the resulting output.tif file, open it in gimp, change the
precision to 8 or 16bit, and remove the alpha channel (right-click the
layer). This is the result of that process:
http://caseyconnor.org/pub/image/aligned_and_medianed.tif
I think it looks pretty good -- maybe not as nice as photoshop, but that
may just be the "contrast" that PS seems to have added. Note how the
median, as opposed to the mean, eliminates the most mis-aligned frames
automatically: those bad frames are left in if you average/mean the
frames. As mentioned, I think you can make it look a lot better by
taking better original pictures.
Even if you use PS to align the images, you should look into using gmic
to take the median, rather than stacking the layers. Just remember that
gmic outputs 32bit-float RGBA images, and you'll usually want/need to
convert those to something more common.
(Note: current stable releases of gimp don't support high-precision
images -- not sure if they will open the 32bit out of gmic or not. I'm
using 2.9.5.)
-c
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]