Forgot Password
Pentax Camera Forums Home
 

Reply
Show Printable Version 4 Likes Search this Thread
10-08-2019, 12:31 AM   #1
Pentaxian




Join Date: Feb 2015
Photos: Gallery
Posts: 12,253
Focus stacking problem

This is post asking for help or ideas about stacking multiple images focused on different areas of the same scene so that to achieve larger aparent depth of field in the resuting image.
I've shot two landscape images, hand held, one image focused on the immediate foreground (flowers) and one other image focus on the mountain background. But I was not able to align them, hence not able to stack them.
Also, using GIMP freeware, I tried to create masks by converting an image to gray scale, then using either an edge detect filter, or high pass filter and boosting contrast, but that didn't work well to produce a mask for blending in a focus stack. Assuming I was able to align frames properly, is there a way to process an image in order to create a create a luminosity mask for each image of a focus stack , so that no special software is need to stack focus?

10-08-2019, 02:42 AM   #2
Junior Member




Join Date: Sep 2019
Posts: 37
The focal length (hence magnification) changes in some lenses when changing the focus. Could this be one of the reasons you weren't able to align the pictures?
10-08-2019, 04:04 AM   #3
Senior Member




Join Date: Feb 2016
Posts: 118
Two reasons why I could imagine.

1) You shot handheld so the images do not have exactly the same framing.

2) As PentaMiCL points out, there is this thing called focus breathing so focal length differs when you change the focus.

Maybe you could post the images to get more precise answers.
10-08-2019, 04:14 AM   #4
Veteran Member
veato's Avatar

Join Date: Oct 2011
Location: Nottingham
Posts: 543
As above; handheld + change in focus I suspect is not going to give you images that are easily aligned.

10-08-2019, 04:42 AM   #5
Pentaxian




Join Date: Feb 2015
Photos: Gallery
Posts: 12,253
Original Poster
QuoteOriginally posted by PentaMiCL Quote
The focal length (hence magnification) changes in some lenses when changing the focus.
QuoteOriginally posted by krazny Quote
1) You shot handheld so the images do not have exactly the same framing.
QuoteOriginally posted by veato Quote
As above; handheld + change in focus I suspect is not going to give you images that are easily aligned.
You are all right. The lens (D-FA28-105) has focus breathing, so the image focused on the foreground doesn't give the same size of landscape features as the image focused on the background. On top of that, the images have X+Y offset and a rotation. Hugin crashes when trying to align both images because of insufficient overlap of focus the feature matching is poor. I think I'm going to give up the idea of focus stacking because it's a lot more pain than just stopping down the lens.
10-08-2019, 05:07 AM   #6
Senior Member




Join Date: Feb 2016
Posts: 118
You don't want to use a tripod?
10-08-2019, 05:15 AM   #7
Veteran Member




Join Date: Jul 2016
Posts: 301
QuoteOriginally posted by biz-engineer Quote
You are all right. The lens (D-FA28-105) has focus breathing, so the image focused on the foreground doesn't give the same size of landscape features as the image focused on the background. On top of that, the images have X+Y offset and a rotation. Hugin crashes when trying to align both images because of insufficient overlap of focus the feature matching is poor. I think I'm going to give up the idea of focus stacking because it's a lot more pain than just stopping down the lens.
I've found focus stacking a very helpful tool in landscape photography and would encourage you not not to give up yet. Images can be in focus over the entire range of the photo with it when, AFAIK, there is sometimes no other way to achieve that. I use Affinity Photo for this and it does it very well, automatically aligning the images as the first step, then completing the merge, a very easy, simple way to accomplish a focus stack. It doesn't require absolutely perfect alignment going into the process and can merge several images at one time. Affinity has a one time modest fee and there is a free trial period available. You might try it for focus stacking, or merge as they call it, and see if it works for you.

10-08-2019, 05:38 AM - 1 Like   #8
Site Supporter
Site Supporter
Sir Nameless's Avatar

Join Date: Jul 2015
Location: Mass a chew sits
Photos: Gallery
Posts: 574
I've had good luck with focus stacking in both Affinity and Zerene Stacker (which I use most of the time when stacking). Zerene also has a free trial IIRC. Both are able to cope with focus breathing and misalignment, and even small changes in exposure between shots. Zerene also has the ability to "brush in" a specific frame to the end result, which will help you cope with moving items in the landscape (like clouds or tree branches) if necessary. Affinity might do that as well, but I haven't had the need to try to figure it out yet.

All that said, a tripod in these instances does make life easier.
10-08-2019, 06:24 AM - 1 Like   #9
Loyal Site Supporter
Loyal Site Supporter
MossyRocks's Avatar

Join Date: Nov 2017
Location: Minnesota
Photos: Gallery | Albums
Posts: 2,982
The enfuse tool which is part of Hugin might work for you. You will get to manually align your images using the command line but there are lots of knobs to turn so you should be able, with a few iterations, to get a good alignment. Focus on aligning different aspects in each iteration such as general x/y position, roation, field of view. I would suggest an alignment sequence like: fairly coarse x/y, roation, fine x/y, z (I think that is the one that will handle focus breathing), and a final fine x/y. Then combine the images using enfuse but I don't reccomend using the GUI as it is very feature limited and is rather out of date now.

Here is a tutorial on using enfuse with hugin for focus stacking.
Here is the full documentation on alilgh_image_stack that is part of hugin.
And here is the full documentation on Enfuse that is part of hugin.
10-08-2019, 07:23 AM   #10
Site Supporter
Site Supporter




Join Date: Aug 2015
Location: Alabama
Photos: Gallery
Posts: 698
may be this helps:How to Shoot Handheld Focus Stacks for Macro Photography

macro should be even more challenging.

Last edited by bwgv001; 10-08-2019 at 07:24 AM. Reason: want to add stuff
10-08-2019, 11:21 AM - 1 Like   #11
Loyal Site Supporter
Loyal Site Supporter
Wingincamera's Avatar

Join Date: Oct 2012
Location: Pine Haven, Wyoming
Photos: Gallery | Albums
Posts: 1,182
For focus stacking I usually use a tripod. But for the hand held focus stacking I only use two photos, using center focus point. First I lock the focus on the near subject, then frame my shot which usually moves the focus point further into the frame. Then holding very steady I take the first shot which is pre-focus on the near subject then without moving anything quickly refocus the second shot which is correctly framed. Depending on the F stop used, this works pretty good for me. I use PS to align the two photos and then focus stack. But the best way is using a tripod and live view to choose each focus point without moving the camera.
10-08-2019, 10:52 PM   #12
Pentaxian




Join Date: Feb 2015
Photos: Gallery
Posts: 12,253
Original Poster
QuoteOriginally posted by wanderer2 Quote
Images can be in focus over the entire range of the photo with it when, AFAIK, there is sometimes no other way to achieve that.
Yep, I agree. Although, my attempt was the first attempt to focus stack two images of landscape. It's the learning curve for me. Two images, one focused on far distance and one focused on the foreground are two less because there is no area of the images in good focus that overlap. The image focused on the foreground (like a portrait) is completely blurred in the background, and the other image focused on the background is completely blurred in the foreground (like a portrait shot miss-focused). With no sharp region overlapping between the two image, the software can't find control points. Added to that is the focus breathing of the lens. So, in order to make it easier to stack focus, I should have used a tripod, and I should have taken 3 or more images for the stack, and I could also have raised the camera to a higher position to reduce the discontinuity between the forground subject and the background.

QuoteOriginally posted by Wingincamera Quote
For focus stacking I usually use a tripod.
That, yes. I've been a little too optimistic thinking I could just snap two shots away and stack them later.

QuoteOriginally posted by Wingincamera Quote
First I lock the focus on the near subject, then frame my shot which usually moves the focus point further into the frame. Then holding very steady I take the first shot which is pre-focus on the near subject then without moving anything quickly refocus the second shot which is correctly framed.
That's a brilliant idea.... I actually though about how how I could capture two images focused at two different points without touching the camera...pre-focus yes that's a good idea!
10-09-2019, 06:27 AM - 1 Like   #13
Loyal Site Supporter
Loyal Site Supporter
MossyRocks's Avatar

Join Date: Nov 2017
Location: Minnesota
Photos: Gallery | Albums
Posts: 2,982
QuoteOriginally posted by biz-engineer Quote
Hugin crashes when trying to align both images because of insufficient overlap of focus the feature matching is poor.
Were your running the GUI or the individual components from the command line? I so rarely use the GUI after finding it a bit flaky that I have just been sticking to running things from the command line. You also get a lot more settings to use on the command line. If I find that aligning the image from the command line isn't working on the first pass (takes an excessive amount of time or crashes) I will usually do a coarse X/Y alignment and crop first and then proceed with the other alignments which seem to work after that. By coarse I set the scale option in align_image_stack to 3 while normally using the default of 1, for a fine alignment I will set it to .5, and for ultra fine I will set it to .1
10-09-2019, 06:28 AM   #14
Loyal Site Supporter
Loyal Site Supporter
MossyRocks's Avatar

Join Date: Nov 2017
Location: Minnesota
Photos: Gallery | Albums
Posts: 2,982
QuoteOriginally posted by Wingincamera Quote
For focus stacking I usually use a tripod. But for the hand held focus stacking I only use two photos, using center focus point. First I lock the focus on the near subject, then frame my shot which usually moves the focus point further into the frame. Then holding very steady I take the first shot which is pre-focus on the near subject then without moving anything quickly refocus the second shot which is correctly framed. Depending on the F stop used, this works pretty good for me.
I'm going to have to try this technique some time. It sounds like it should provide fairly reasonable results.
10-09-2019, 06:32 AM   #15
Site Supporter
Site Supporter
Sir Nameless's Avatar

Join Date: Jul 2015
Location: Mass a chew sits
Photos: Gallery
Posts: 574
QuoteOriginally posted by MossyRocks Quote
I'm going to have to try this technique some time.
Me too. I think it would work really well in the right situation (where the center point does end up further away in the scene).
I think the camera would need to be set up for back button focus, correct?
Reply

Bookmarks
  • Submit Thread to Facebook Facebook
  • Submit Thread to Twitter Twitter
  • Submit Thread to Digg Digg
Tags - Make this thread easier to find by adding keywords to it!
create, focus, image, images, photography, photoshop, stack

Similar Threads
Thread Thread Starter Forum Replies Last Post
Focus stacking with hand held shots Basie Digital Processing, Software, and Printing 5 09-02-2019 01:16 PM
Focus Stacking bscott Pentax DSLR Discussion 11 08-31-2018 07:24 AM
Focus stacking on Linux anemone Digital Processing, Software, and Printing 14 07-29-2018 10:54 PM
Focus stacking TonyW Pentax Medium Format 14 12-12-2017 03:46 AM
Focus stacking deal from Focus projects Rnovo Photographic Industry and Professionals 5 07-07-2016 06:06 PM



All times are GMT -7. The time now is 04:40 AM. | See also: NikonForums.com, CanonForums.com part of our network of photo forums!
  • Red (Default)
  • Green
  • Gray
  • Dark
  • Dark Yellow
  • Dark Blue
  • Old Red
  • Old Green
  • Old Gray
  • Dial-Up Style
Hello! It's great to see you back on the forum! Have you considered joining the community?
register
Creating a FREE ACCOUNT takes under a minute, removes ads, and lets you post! [Dismiss]
Top