Quantcast

image alignment/registration

classic Classic list List threaded Threaded
26 messages Options
12
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

image alignment/registration

Casey Connor-2
Hi - I was curious what the best overall image alignment plugin/method
in GIMP (or out of GIMP) was these days?

"Best" for me means "most powerful/flexible/option-rich".

I've come across the hugin align_image_stack, the G'MIC plugin's "Align
layers" option, and the image registration plugin
<http://gimp-image-reg.sourceforge.net/>. (I've also used the "Exact
Aligner" script, but it's two layers only.)

The goal is to align and then use mean/median for noise reduction
stacking. I'll probably be working in 16bit.

Do all three methods do sub-pixel alignment? I read someone on pixls.us
suggesting that the user upscale the source images by up to 1.33x before
aligning for the sake of effectively achieving sub-pixel alignment, but
if the current alignment methods do that anyway, seems like I should
skip it... ?

Thanks!

-c


_______________________________________________
gimp-user-list mailing list
List address:    [hidden email]
List membership: https://mail.gnome.org/mailman/listinfo/gimp-user-list
List archives:   https://mail.gnome.org/archives/gimp-user-list
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: image alignment/registration

Pat David
Align_image_stack is usually the best option other than possibly attempting
it manually directly in Hugin.
On Sat, Feb 4, 2017 at 8:57 PM Casey Connor <[hidden email]>
wrote:

> Hi - I was curious what the best overall image alignment plugin/method
> in GIMP (or out of GIMP) was these days?
>
> "Best" for me means "most powerful/flexible/option-rich".
>
> I've come across the hugin align_image_stack, the G'MIC plugin's "Align
> layers" option, and the image registration plugin
> <http://gimp-image-reg.sourceforge.net/>. (I've also used the "Exact
> Aligner" script, but it's two layers only.)
>
> The goal is to align and then use mean/median for noise reduction
> stacking. I'll probably be working in 16bit.
>
> Do all three methods do sub-pixel alignment? I read someone on pixls.us
> suggesting that the user upscale the source images by up to 1.33x before
> aligning for the sake of effectively achieving sub-pixel alignment, but
> if the current alignment methods do that anyway, seems like I should
> skip it... ?
>
> Thanks!
>
> -c
>
>
> _______________________________________________
> gimp-user-list mailing list
> List address:    [hidden email]
> List membership: https://mail.gnome.org/mailman/listinfo/gimp-user-list
> List archives:   https://mail.gnome.org/archives/gimp-user-list
>
--
Pat David
GPG: 66D1 7CA6 8088 4874 946D  18BD 67C7 6219 89E9 57AC
_______________________________________________
gimp-user-list mailing list
List address:    [hidden email]
List membership: https://mail.gnome.org/mailman/listinfo/gimp-user-list
List archives:   https://mail.gnome.org/archives/gimp-user-list
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

image alignment/registration

oneaty
>Align_image_stack is usually the best option other than possibly
>attempting
>it manually directly in Hugin.
>On Sat, Feb 4, 2017 at 8:57 PM Casey Connor
><[hidden email]>
>wrote:
I tried align_image_stack many times, using different options combinations, but
coudn't get aligned images in the end.
I'm trying to abandon PS and fully use gnu software, but, so far, couldn't find
a decent replacent for PS's autoalign feature.
The point is that I didn't use tripod, so there are alignment differences in the
original frames. PS's autoalign can handle that situation in a very satisfactory
manner.
Am I missing something?
I don't want to piggyback Casey's post, but since I have the same question, I
choose to put this post here.
If admins feel I should open another thread, just let me know.



--
oneaty (via www.gimpusers.com/forums)
_______________________________________________
gimp-user-list mailing list
List address:    [hidden email]
List membership: https://mail.gnome.org/mailman/listinfo/gimp-user-list
List archives:   https://mail.gnome.org/archives/gimp-user-list
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: image alignment/registration

Casey Connor-2
> I tried align_image_stack many times, using different options combinations, but
> coudn't get aligned images in the end.

Per recommendations here, I've used it and it worked really well; I've
read, and experienced, that it seems to need images to be pretty close
already. Meaning, by default it won't assume the images should be
aligned a great distance, so if you moved much while shooting it might
not work out. You might investigate the -g option -- I'm not totally
clear on how it works, but it sounds from the description like it might
change the scale which align_image_stack uses to find control points.
Maybe also the -t option?

You could also check out hugin, which AFAIK uses align_image_stack under
the hood to do its alignment. It allows all kinds of manual
intervention/editing of control points. I understand that a "one-click"
solution is ideal, but mention it just in case. You can at least
visually see what's happening with the control points and understand
better where things are going wrong.

-c

_______________________________________________
gimp-user-list mailing list
List address:    [hidden email]
List membership: https://mail.gnome.org/mailman/listinfo/gimp-user-list
List archives:   https://mail.gnome.org/archives/gimp-user-list
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

image alignment/registration

oneaty
>Per recommendations here, I've used it and it worked really well; I've
>read, and experienced, that it seems to need images to be pretty close

Thanks for the feedback.
I believe if I shoot with a tripod it would work fine.
The point is that a tripod isn't an option to me most of the time.
My only camera is an old point & shoot Canon A3100, boosted by CHDK. CHDK has
many wonderful features, but the one I mostly use is its raw capability, not
available on Canon original  firmware.
Besides, I usually do a lot of stacking, pushing the final image quality to its
limits.
And here is my problem.
With PS, I can auto align hand held shots with excellent results. The
differences in perspective between shots do exist but are not big, because I try
to hold the camera the most steadier I can when shooting.
I just came from aligning the same set of pictures in PS I tried in Hugin, and
it worked almost perfectly.
Before that, I had also tried using JImage (and its full package FiJi), but it
is really, really complex and I gave up.
So, unfortunately (being an open source fan), I will still have to keep with PS,
until I find an open source alternative to its auto alignment feature.


--
oneaty (via www.gimpusers.com/forums)
_______________________________________________
gimp-user-list mailing list
List address:    [hidden email]
List membership: https://mail.gnome.org/mailman/listinfo/gimp-user-list
List archives:   https://mail.gnome.org/archives/gimp-user-list
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: image alignment/registration

Casey Connor-2
Did you try the -g option with align_image_stack? Or -t?

I align hand-held images with align_image_stack and it works fine, even
without those options... e.g. this one:
https://www.flickr.com/photos/lacinato/32628735771/in/dateposted-public/

-c

On 03/24/2017 12:58 PM, oneaty wrote:

>> Per recommendations here, I've used it and it worked really well; I've
>> read, and experienced, that it seems to need images to be pretty close
> Thanks for the feedback.
> I believe if I shoot with a tripod it would work fine.
> The point is that a tripod isn't an option to me most of the time.
> My only camera is an old point & shoot Canon A3100, boosted by CHDK. CHDK has
> many wonderful features, but the one I mostly use is its raw capability, not
> available on Canon original  firmware.
> Besides, I usually do a lot of stacking, pushing the final image quality to its
> limits.
> And here is my problem.
> With PS, I can auto align hand held shots with excellent results. The
> differences in perspective between shots do exist but are not big, because I try
> to hold the camera the most steadier I can when shooting.
> I just came from aligning the same set of pictures in PS I tried in Hugin, and
> it worked almost perfectly.
> Before that, I had also tried using JImage (and its full package FiJi), but it
> is really, really complex and I gave up.
> So, unfortunately (being an open source fan), I will still have to keep with PS,
> until I find an open source alternative to its auto alignment feature.
>
>

_______________________________________________
gimp-user-list mailing list
List address:    [hidden email]
List membership: https://mail.gnome.org/mailman/listinfo/gimp-user-list
List archives:   https://mail.gnome.org/archives/gimp-user-list
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

image alignment/registration

oneaty
>Did you try the -g option with align_image_stack? Or -t?
>
>I align hand-held images with align_image_stack and it works fine,
>even
>without those options... e.g. this one:
>https://www.flickr.com/photos/lacinato/32628735771/in/dateposted-public/
>
>-c

Tried

align_image_stack -a *.tif

and

align_image_stack -a -g *.tif

and no success...

--
oneaty (via www.gimpusers.com/forums)
_______________________________________________
gimp-user-list mailing list
List address:    [hidden email]
List membership: https://mail.gnome.org/mailman/listinfo/gimp-user-list
List archives:   https://mail.gnome.org/archives/gimp-user-list
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

image alignment/registration

oneaty
>Tried
>
>align_image_stack -a *.tif
>
>and
>
>align_image_stack -a -g *.tif
>
>and no success...

The whole process:

1 - Shoot in DNG
2 - RawTherappe - Open dng's with preset Neutral and save them as tif
3 - align_image_stack.

Btw, beautiful image.

--
oneaty (via www.gimpusers.com/forums)
_______________________________________________
gimp-user-list mailing list
List address:    [hidden email]
List membership: https://mail.gnome.org/mailman/listinfo/gimp-user-list
List archives:   https://mail.gnome.org/archives/gimp-user-list
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: image alignment/registration

Casey Connor-2
In reply to this post by oneaty
So, backing up a step: when you say align_image_stack doesn't work, what
do you mean exactly? I assumed you meant that it did a poor job aligning
the images, but I don't think the command lines you list there would
even work to start the program, so I'm wondering now if you meant that
it doesn't even run?

"-a" requires a prefix following it, and "-g" requires a number.

E.g.:

align_image_stack -a someprefix -g 8 *.tif

Documentation is here: http://wiki.panotools.org/Align_image_stack

_______________________________________________
gimp-user-list mailing list
List address:    [hidden email]
List membership: https://mail.gnome.org/mailman/listinfo/gimp-user-list
List archives:   https://mail.gnome.org/archives/gimp-user-list
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

image alignment/registration

oneaty
>So, backing up a step: when you say align_image_stack doesn't work,
>what
>do you mean exactly? I assumed you meant that it did a poor job
>aligning
>the images,

Correct assumption,


but I don't think the command lines you list there would

>even work to start the program, so I'm wondering now if you meant that
>it doesn't even run?
>
>"-a" requires a prefix following it, and "-g" requires a number.
>
>E.g.:
>
>align_image_stack -a someprefix -g 8 *.tif
>
>Documentation is here: http://wiki.panotools.org/Align_image_stack

Well, it works.

-a without explicit prefix defaults to the name of the first image file given.

-g without explicit number defaults to 5 (that is written in the --help option)

Btw, what os are you using?

I'm running this on Linux (Ubuntu 16.04)

--
oneaty (via www.gimpusers.com/forums)
_______________________________________________
gimp-user-list mailing list
List address:    [hidden email]
List membership: https://mail.gnome.org/mailman/listinfo/gimp-user-list
List archives:   https://mail.gnome.org/archives/gimp-user-list
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: image alignment/registration

Casey Connor-2
Ah, ok. So what exactly goes wrong: one or two of the images is off-kilter?

If you specify -g, try using something besides the default, as I'm not
sure that using the default will change the behavior. (Meaning, not
specifying -g probably results in the same thing as just "-g" -- the
documentation is a little unclear, but I assume it's active when not
specified.) Perhaps try -g 3 or 4 instead? I'm not 100% sure how to
interpret it. If that doesn't work, try 6 or 7?

> Btw, what os are you using?

Kubuntu 16.10.

-c

_______________________________________________
gimp-user-list mailing list
List address:    [hidden email]
List membership: https://mail.gnome.org/mailman/listinfo/gimp-user-list
List archives:   https://mail.gnome.org/archives/gimp-user-list
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

image alignment/registration

oneaty
>Ah, ok. So what exactly goes wrong: one or two of the images is
>off-kilter?

Yes, that's it. I'm just checking the first two images, since PS successfully
aligned all of them.

>
>If you specify -g, try using something besides the default, as I'm not
>sure that using the default will change the behavior. (Meaning, not
>specifying -g probably results in the same thing as just "-g" -- the
>documentation is a little unclear, but I assume it's active when not
>specified.) Perhaps try -g 3 or 4 instead? I'm not 100% sure how to
>interpret it. If that doesn't work, try 6 or 7?
>Kubuntu 16.10.
>
>-c

I tried

align_image_stack -a align -g 10 -t 5 *.tif

and

align_image_stack -a -dixyz *.tif

and

align_image_stack -a align -SAP *.tif

and the images (the first two) are still unaligned

The resulting stack by using Photoshop can be seen here https://flic.kr/p/SDKdBf

--
oneaty (via www.gimpusers.com/forums)
_______________________________________________
gimp-user-list mailing list
List address:    [hidden email]
List membership: https://mail.gnome.org/mailman/listinfo/gimp-user-list
List archives:   https://mail.gnome.org/archives/gimp-user-list
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: image alignment/registration

Casey Connor-2

> I tried
>
> align_image_stack -a align -g 10 -t 5 *.tif

Did you try with a lower-than-default -g? E.g. "-g 3"?

If you want to upload the base .tif files somewhere, I can try to align
them, so we can see if there is some strange difference between
align_image_stack on our machines.

-c

_______________________________________________
gimp-user-list mailing list
List address:    [hidden email]
List membership: https://mail.gnome.org/mailman/listinfo/gimp-user-list
List archives:   https://mail.gnome.org/archives/gimp-user-list
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

image alignment/registration

oneaty
>Did you try with a lower-than-default -g? E.g. "-g 3"?
>
>If you want to upload the base .tif files somewhere, I can try to
>align
>them, so we can see if there is some strange difference between
>align_image_stack on our machines.
>
>-c
Hey, thanks for that!

Follows Flickr album https://flic.kr/s/aHskT2xjh1

--
oneaty (via www.gimpusers.com/forums)
_______________________________________________
gimp-user-list mailing list
List address:    [hidden email]
List membership: https://mail.gnome.org/mailman/listinfo/gimp-user-list
List archives:   https://mail.gnome.org/archives/gimp-user-list
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

image alignment/registration

oneaty
>Hey, thanks for that!
>
>Follows Flickr album https://flic.kr/s/aHskT2xjh1

EDIT: I noticed that Flickr automatically changed the tiffs I uploaded into
jpgs, so I wanted to make sure it wouldn't be a waste of time to you.
I did what I suppose you'll do:
1 - Downloaded Flickr album
2 - Aligned the images with align_image_stack
3 - Opened the output from previous step as layers in Gimp.
4 - Changed layers opacity according to the mean rule (100%, 50%, 33%...)
4 - Did the same on PS

Conclusion: The format change didn't interfere in the original alignment issue:
PS correctly auto-aligned the layers, but align_image_stack didn't.

The following images are screen shots from both ps and gimp showing the final
stacks: http://imgur.com/a/drKdB

--
oneaty (via www.gimpusers.com/forums)
_______________________________________________
gimp-user-list mailing list
List address:    [hidden email]
List membership: https://mail.gnome.org/mailman/listinfo/gimp-user-list
List archives:   https://mail.gnome.org/archives/gimp-user-list
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: image alignment/registration

Casey Connor-2
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

_______________________________________________
gimp-user-list mailing list
List address:    [hidden email]
List membership: https://mail.gnome.org/mailman/listinfo/gimp-user-list
List archives:   https://mail.gnome.org/archives/gimp-user-list
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

image alignment/registration

oneaty
>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:

Yeah, I suspect it had to do with the lens distortion, but, in this specific
photo, I couldn't have place myself more distant because that was a corridor.

>
>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!)
>

The only thing I did was applying the input script open stack or something like
that (can't remember at this point its name) and changing the opacity. You're
probably right assuming PS did some ajustments, because it probably calls Camera
Raw under the hoods when opening the raw files, and by default, Camera Raw uses
to open with some default settings already applied.

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

I have tried the median method but, somehow, I generally prefer the median. As
for the process being tedious, you're right, it is, although there is a much
simpler way of doing exactly the same thing in PS, just by changing all the
layers into Smart Object. Then you can apply in a single click the various
stacking modes (including, of course, mean and median). Anyway, I'll give gmic a
try.

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

It certainly looks very good!
However, it's not clear after all, if you used gmic after align_stack or just
applied it directly to the original frames.

>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

I'm using the latest developing version, 2.9.something, and it already supports,
at least, 16-bit images. Not sure about 32-bit.

I feel like the open source tools are getting close to PS, regarding the
stacking process. As for the rest, RawTherapee is really an option, and maybe
Gimp sooner.

--
oneaty (via www.gimpusers.com/forums)
_______________________________________________
gimp-user-list mailing list
List address:    [hidden email]
List membership: https://mail.gnome.org/mailman/listinfo/gimp-user-list
List archives:   https://mail.gnome.org/archives/gimp-user-list
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: image alignment/registration

Casey Connor-2
>> 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
> It certainly looks very good!
> However, it's not clear after all, if you used gmic after align_stack or just
> applied it directly to the original frames.

I did align_image_stack, and then applied gmic to the aligned frames.

> I'm using the latest developing version, 2.9.something, and it already supports,
> at least, 16-bit images. Not sure about 32-bit.

Yeah, it should work fine.

It's interesting to see that PS apparently handles lens distortion when
aligning images -- those are impressive results. But maybe
align_image_stack + gmic + gimp can work for you in some cases, too.

Good luck with it,
-c

_______________________________________________
gimp-user-list mailing list
List address:    [hidden email]
List membership: https://mail.gnome.org/mailman/listinfo/gimp-user-list
List archives:   https://mail.gnome.org/archives/gimp-user-list
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: image alignment/registration

Casey Connor-2
In reply to this post by oneaty
One last thought: if you are going to remove the barrel distortion in
those images, you might try removing it before doing the image
alignment... that might allow align_image_stack to work better... -c


_______________________________________________
gimp-user-list mailing list
List address:    [hidden email]
List membership: https://mail.gnome.org/mailman/listinfo/gimp-user-list
List archives:   https://mail.gnome.org/archives/gimp-user-list
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

image alignment/registration

oneaty
>One last thought: if you are going to remove the barrel distortion in
>those images, you might try removing it before doing the image
>alignment... that might allow align_image_stack to work better... -c

That's a good idea, I'll try that.

Besides, many thanks for your patience and willingness to help.

I hope soon Gimp will present us a new alignment algorithm so we can forget,
forever and ever, closed source apps.

Best wishes!

--
oneaty (via www.gimpusers.com/forums)
_______________________________________________
gimp-user-list mailing list
List address:    [hidden email]
List membership: https://mail.gnome.org/mailman/listinfo/gimp-user-list
List archives:   https://mail.gnome.org/archives/gimp-user-list
12
Loading...