Jump to content
You must now use your email address to sign in [click for more info] ×

How do I avoid ghosting when focus stacking?


Recommended Posts

  • Staff

These differences are possibly down to vibration of the camera when the shutter is physically pressed or potentially even the mirror mechanics vibrating the camera.

I would advise a mirror lockup mode and a remote trigger if you have one.

 

Lee

Link to comment
Share on other sites

The thing is, I used the built in focus bracketing function in my camera, so I did not have to touch the camera at all while it was shooting. I even used a 2 second timer to let any vibrations dissipate before it shoots AND 2 seconds between each photo. 
 

My camera is a mirrorless camera too (Fuji X-T2), so no mirror slap to worry about. I guess there could be vibration from the shutter. I’m gonna re do this with an electronic shutter and see how that goes. 

Link to comment
Share on other sites

Here are two more attempts. First one was with mechanical shutter second with electronic shutter. Same settings for both. Same results. Better results, but there is still some ghosting, especially on the right side of the box. I don’t know what’s causing it. 
 

Only used 18 and 17 photos this time, maybe that has something to do with it? Does the results usually get worse the more photos you use? 

6706183E-9F18-482E-882C-14EE6702B63D.jpeg

D34F3DA9-14E5-4E0C-923D-51D47EC8B804.jpeg

Link to comment
Share on other sites

  • Staff

If you are shooting raw, I would put this down to focus breathing on the lens, (the small differences the movement in the lens make to the image). If you aren't shooting raw it could be the differences in post processing applied to each image within the camera for different shots. With more images the more these differences will show up.

You could perhaps negate this a -little- by overstacking an important image (selecting multiple copies of the same image with the details you consider most important clearly visible), weighing the overall process in favour of that image.

It's still likely you'll have to perform some minor repair to rid yourself completely of ghosting without using hardware dedicated to the task.

 

Link to comment
Share on other sites

Quote

If you are shooting raw, I would put this down to focus breathing on the lens

How does file format affect focus breathing? That’s an optical property of the lens. I know newer Sony cameras can compensate for focus breathing during videography, maybe even photography, but that is a very new feature that most cameras don’t have.

Quote

If you aren't shooting raw it could be the differences in post processing applied to each image within the camera for different shots

I did not apply any processing on these. Shot RAW and exported as jpeg, then stitched the jpegs. But I did use light from the window, so that could maybe have been changing during some of the shots. As a matter of fact, the most ghosting you see on the last two examples happened on the side of the box with the most direct light from the window. That might be my proble. Gonna try again tonight when it’s dark and I can use only artificial light.

Never heard of over stacking before, but I’ll try to keep it in mind as sometime to try.

27 minutes ago, LeeThorpe said:

It's still likely you'll have to perform some minor repair to rid yourself completely 

of ghosting

You mean editing in post right? Not camera/lens repair?

27 minutes ago, LeeThorpe said:

without using hardware dedicated to the task.

What kind of hardware would that be? Maybe a tilt shift lens? Edit: my suggestion of a tilt shift lens made no sense as an answer to your statement… though it’s a thing I want. 

Link to comment
Share on other sites

Another perspective: might be caused by the subject. The worn-out paper hull with lots of finest details may irritate the focus merge.

focus merge looks for high contrast pixels, and these details in the sub-pixel resolution wont help.

The image looks good at smooth surfaces and real edges.

Mac mini M1 A2348 | Windows 10 - AMD Ryzen 9 5900x - 32 GB RAM - Nvidia GTX 1080

LG34WK950U-W, calibrated to DCI-P3 with LG Calibration Studio / Spider 5

iPad Air Gen 5 (2022) A2589

Special interest into procedural texture filter, edit alpha channel, RGB/16 and RGB/32 color formats, stacking, finding root causes for misbehaving files, finding creative solutions for unsolvable tasks, finding bugs in Apps.

 

Link to comment
Share on other sites

Honst question: what do you want to achieve?

Focus stacking will bring out finest details. It will work best on subjects who have interesting fine details, like small insects, watch drives, etc, good lighting to bring out colors and details. If you use images with worn paper, grey random dust like edges, what is the purpose of the whole exercise ? The focus stacking algorithms will find and emphasize distracting details you actually won’t want.

Next, the background seems totally random, distracting, and changing between images. You need to carefully stage the background, normally totally uniform (smoooth) background which virtually vanishes (e.g. white with bright light to be intentionally getting outblown, or black as black could get, or out of canvas bokeh)
 

Mac mini M1 A2348 | Windows 10 - AMD Ryzen 9 5900x - 32 GB RAM - Nvidia GTX 1080

LG34WK950U-W, calibrated to DCI-P3 with LG Calibration Studio / Spider 5

iPad Air Gen 5 (2022) A2589

Special interest into procedural texture filter, edit alpha channel, RGB/16 and RGB/32 color formats, stacking, finding root causes for misbehaving files, finding creative solutions for unsolvable tasks, finding bugs in Apps.

 

Link to comment
Share on other sites

This was just a test so I did not care about the background.

What I’m aiming for is to maybe use focus stacking for my playing card shots, like these: https://www.instagram.com/52_eirik/ 

As you can see, some of my shots does not have all of the box in focus. I’m not sure I mind that personally, but I know some of the more dedicated playing card collectors wants more details. But I can only stop down the lens so much.

Honestly, what I would love to have the most would be a bellows system like this guy has. But I think it’s a bit over the top for a hobby photographer like me.

 

Link to comment
Share on other sites

17 minutes ago, Eirik said:

What I’m aiming for is to maybe use focus stacking for my playing card shots, like these: https://www.instagram.com/52_eirik/ 

Most of the images show razor-thin depth of field. The opposite of focus stacking.

Never the less, the subjects are either perfect, shots taken with excellent lens, or heavy post processing is applied. 
You can’t achieve this results with focus stacking (unless adding blur in post)

Mac mini M1 A2348 | Windows 10 - AMD Ryzen 9 5900x - 32 GB RAM - Nvidia GTX 1080

LG34WK950U-W, calibrated to DCI-P3 with LG Calibration Studio / Spider 5

iPad Air Gen 5 (2022) A2589

Special interest into procedural texture filter, edit alpha channel, RGB/16 and RGB/32 color formats, stacking, finding root causes for misbehaving files, finding creative solutions for unsolvable tasks, finding bugs in Apps.

 

Link to comment
Share on other sites

Quote

Never the less, the subjects are either perfect, shots taken with excellent lens, or heavy post processing is applied. 

My shots you mean? They WERE shot with a very good lens, yes. Some processing was done to the colors and contrast, yes. But the main reason they look good, I think, is because of the lights I was using.

The background is there while shooting, but I take a photo of the background without the deck in it and then I blended the photo of the deck and the one without the deck together. I do that to remove the support I am using to hold the deck up with.

And so my goal was to do focus stacks of the decks with all the lights set up and then use that stacked image the same way I use my photo of the decks now, blending it together with a shot of the background without the deck.

if you wanna see a couple photos of my setup, go to the last two shots in this thread on Reddit. I know it’s kinda low budget but it works for me. (Yes that is Lego… :P) 

 

Link to comment
Share on other sites

  • Staff
19 hours ago, Eirik said:

How does file format affect focus breathing? That’s an optical property of the lens. I know newer Sony cameras can compensate for focus breathing during videography, maybe even photography, but that is a very new feature that most cameras don’t have.

I did not apply any processing on these. Shot RAW and exported as jpeg, then stitched the jpegs. But I did use light from the window, so that could maybe have been changing during some of the shots. As a matter of fact, the most ghosting you see on the last two examples happened on the side of the box with the most direct light from the window. That might be my proble. Gonna try again tonight when it’s dark and I can use only artificial light.

Never heard of over stacking before, but I’ll try to keep it in mind as sometime to try.

You mean editing in post right? Not camera/lens repair?

What kind of hardware would that be? Maybe a tilt shift lens? Edit: my suggestion of a tilt shift lens made no sense as an answer to your statement… though it’s a thing I want. 

Sorry, could have been clearer, what I mean is that if you are using Raw then that means we can rule out any in camera post processing differences causing ghosting in the stacked output, leaving little else to consider but lens breathing.

I doubt that it's a hardware issue, just that every lens has a differing amount of focus breathing, the only way to find a lens with less breathing is to research i'm afraid.

For this kind of work people would generally use a focus stacking rail like this: 

DSC_1759.jpg

Lee

Link to comment
Share on other sites

I don’t understand how that rail is different.

Focus breathing makes the lens “zoom in” as you focus closer, right? It makes the subject in the frame bigger when you focus closer.

How is physically moving the camera closer to the subject different? Won’t it also make the subject bigger within the frame?

And I was also under the impression that the app was compensating for difference in size of the subject.

Again, I’m obviously a noob, but it sounds weird to me that focus breathing could be the culprit behind the ghosting you’re seeing in these tests. I think it’s more likely that the light in the room changed just a little bit during shooting since I was just using natural light from a window. I still have not gotten around to testing this by shooting another stack in the dark with artificial light. 
 

 

Link to comment
Share on other sites

  • 3 months later...

I don’t know why one of them looks different than the other, but they have the same settings. I guess one of them has a different profile (like adobergb) embedded or something. Anyway, you can still see the glow/ghosting effect. The single frame does not have it. Any way to avoid this? Am I just not taking enough photos?

 

btw, I’m using artificial lighting this time. It stayed the same during the whole shoot. 

Link to comment
Share on other sites

  • Staff

In reality this is a photography problem as opposed to a problem with Affinity. If you cycle back and forth between the two images above, you can actually see the focus breathing.

The solution to overcoming the pure physics of the light entering the camera very slightly differently on each photograph is to pick which layer you wish to display at any given part of the image where you have a ghosting issue. 

James' Focus stacking video tutorial goes into this process.

https://affinity.serif.com/en-gb/tutorials/photo/desktop/video/295557891/

Lee

Link to comment
Share on other sites

The image shows a very strong micro-pattern when using some analytic filters (gaussian blur with 0.1px radius, blend mode difference. plus levels adjustment to boost brightness).

2104277334_Screenshot2022-10-10at20_24_50.thumb.png.8039957d3e5b46161a3c1d7022a5d99c.png

How do you pre-process the images? I would suggest to apply some noise removal before stacking, and don't sharpen (or reduce sharpening, do it after stacking)

Could you upload one RAW file and the processes image (TIFF if possible, no compression).

 

Below one of my stacks, with a patch of one of the stacked images. My results were always next to perfect wrt to focus merge (based on the source images).

I used f9 and about 8-16 images to cover the relevant depth of field with sharp images and small enough steps. (Macro lens, EF-S 60)

Screenshot 2022-10-10 at 20.20.15.png

Mac mini M1 A2348 | Windows 10 - AMD Ryzen 9 5900x - 32 GB RAM - Nvidia GTX 1080

LG34WK950U-W, calibrated to DCI-P3 with LG Calibration Studio / Spider 5

iPad Air Gen 5 (2022) A2589

Special interest into procedural texture filter, edit alpha channel, RGB/16 and RGB/32 color formats, stacking, finding root causes for misbehaving files, finding creative solutions for unsolvable tasks, finding bugs in Apps.

 

Link to comment
Share on other sites

17 hours ago, LeeThorpe said:

In reality this is a photography problem as opposed to a problem with Affinity. If you cycle back and forth between the two images above, you can actually see the focus breathing.

The solution to overcoming the pure physics of the light entering the camera very slightly differently on each photograph is to pick which layer you wish to display at any given part of the image where you have a ghosting issue. 

James' Focus stacking video tutorial goes into this process.

https://affinity.serif.com/en-gb/tutorials/photo/desktop/video/295557891/

Lee

Hmm I’ll have a look at that. But I do rely on Affinity to make the final product for me. I’m not importing each photo in separate layers and manually masking out everything I don’t want. I guess I could, but I’m not doing that. 

13 hours ago, NotMyFault said:

The image shows a very strong micro-pattern when using some analytic filters (gaussian blur with 0.1px radius, blend mode difference. plus levels adjustment to boost brightness).

 

How do you pre-process the images? I would suggest to apply some noise removal before stacking, and don't sharpen (or reduce sharpening, do it after stacking)

Could you upload one RAW file and the processes image (TIFF if possible, no compression).

 

Below one of my stacks, with a patch of one of the stacked images. My results were always next to perfect wrt to focus merge (based on the source images).

I used f9 and about 8-16 images to cover the relevant depth of field with sharp images and small enough steps. (Macro lens, EF-S 60)

 

I wonder if that pattern comes from the fact that I’m shooting with Fujifilm? 
 

I did not edit much, no more than the standard sharpening in Lightroom. I increased the exposure and lowered the highlights some.

 

I shoot more photos than you did though. I used wider apertures so I needed more photos I think. I tried apertures from f2 to f5.6 and I shot between 25 and 50 photos. The reason I don’t stop down more is because I want the background to be very soft. That way I hide imperfections in the background and I like how it looks. If I were to shoot at f9 I’d get most of the box in focus in a single frame. 

I’m done with this shot though, I chose to just use one of the single shots instead of the stacked. But I have the red version of this deck and I’ll be shooting that soon. I’ll try focus stacking again then.

Link to comment
Share on other sites

29 minutes ago, Eirik said:

I shoot more photos than you did though. I used wider apertures so I needed more photos I think. I tried apertures from f2 to f5.6 and I shot between 25 and 50 photos. The reason I don’t stop down more is because I want the background to be very soft. That way I hide imperfections in the background and I like how it looks. If I were to shoot at f9 I’d get most of the box in focus in a single frame. 

 

These 2 are totally conflicting targets (focus stack vs. soft background). 
If you use fewer but sharper images you probably get far better results. This is key, please don‘t try to work against „the system“ and established best practices. You can‘t achieve good focus stacks if not choosing the sharpest possible source images. It will not work well.

BTW the stacked image looks tonally very different from the source image. 

Mac mini M1 A2348 | Windows 10 - AMD Ryzen 9 5900x - 32 GB RAM - Nvidia GTX 1080

LG34WK950U-W, calibrated to DCI-P3 with LG Calibration Studio / Spider 5

iPad Air Gen 5 (2022) A2589

Special interest into procedural texture filter, edit alpha channel, RGB/16 and RGB/32 color formats, stacking, finding root causes for misbehaving files, finding creative solutions for unsolvable tasks, finding bugs in Apps.

 

Link to comment
Share on other sites

  • Staff
31 minutes ago, Eirik said:

Hmm I’ll have a look at that. But I do rely on Affinity to make the final product for me. I’m not importing each photo in separate layers and manually masking out everything I don’t want. I guess I could, but I’m not doing that.

Watch the tutorial I linked from this timestamp. 

immediately after you complete a merge, you are presented with the source panel and clone brush to deal with this situation.

https://youtu.be/g-FfqZWnlPQ?t=74

Lee

 

 

Link to comment
Share on other sites

4 hours ago, LeeThorpe said:

Watch the tutorial I linked from this timestamp. 

immediately after you complete a merge, you are presented with the source panel and clone brush to deal with this situation.

https://youtu.be/g-FfqZWnlPQ?t=74

Lee

 

 

Im on iPad, I don’t think I get that source panel. Or maybe it’s hidden or I’m just not good at paying attention. 

4 hours ago, NotMyFault said:

These 2 are totally conflicting targets (focus stack vs. soft background). 
If you use fewer but sharper images you probably get far better results. This is key, please don‘t try to work against „the system“ and established best practices. You can‘t achieve good focus stacks if not choosing the sharpest possible source images. It will not work well.

BTW the stacked image looks tonally very different from the source image. 

To me the whole point of focus stacking IS to have a wider depth of field AND a soft background. But sure, I guess that is not easy to achieve. If I can’t make it work then I’ll just go back to shooting the way I used to. 
 

That difference in color is only here on the website. When I exported the it from Affinity I probably chose something other than sRGB. While the other one was exported from Lightroom where I already have set sRGB as the default. 

Link to comment
Share on other sites

  • 1 year later...

I'm new at the focus stacking game too. Struggled last night with a macro rail and an old macro lens. Tried today with the kit lens that can get close enough for my Lego sets that I want to sell, because the kit lens allows the camera to do focus shifting rather than fiddling with the macro rail. Much better results. And now at night again I get the same ghosting or glare! So it's clearly the lighting that messes with my focus stacking software. Daylight from the window is good enough, my LED light and improvised umbrella softbox doesn't cut it. Yellow point light bokeh balls become overexposed, ghosting and glare not visible in individual images get exaggerated. I'll switch to small aperture/long exposure for my night time activities until I get some studio lights 

Edited by Joffemannen
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.