Using layers to overcome transparent rendering by TuFuse

A forum to ask questions, post setups, and generally discuss anything having to do with photomacrography and photomicroscopy.

Moderators: rjlittlefield, ChrisR, Chris S., Pau

rjlittlefield
Site Admin
Posts: 23561
Joined: Tue Aug 01, 2006 8:34 am
Location: Richland, Washington State, USA
Contact:

Using layers to overcome transparent rendering by TuFuse

Post by rjlittlefield »

With apologies to Laurie's beautifully posed and lighted study, I set up a similar situation to experiment with methods to overcome bogus transparency.

The strategy shown here is simple: use TuFuse to render separately all of the frames and just the foreground stuff, then use Photoshop masking to manually fix up any places where background "shows through" foreground.

For this subject, the process turned out to be pretty straightforward: render twice, import to Photoshop with foreground over background, add a layer mask to hide the foreground-only image, then paint white on the mask with a soft brush to expose the antennae only from the foreground image.

Upper left, all frames, antennae apparently transparent over the eye and mandible;
upper right, foreground frames only, antenna properly opaque;
lower left, manually merged by masking; lower right, blowup of one problematic region after manual fixup.

Image

The final result:
Image

I figure this technique might be helpful sometimes.

Perhaps some version of this could even be automated (though that always ends up being a lot harder than it sounds!). :)

--Rik

Technical: Canon 300D camera, Nikon CF 10X NA 0.30 microscope objective, 124 frames stacked at 0.0002". Flash illumination with pingpong and tissue diffusers, 1.57 mm frame width.

LSRasmussen
Posts: 67
Joined: Mon Apr 14, 2008 9:21 am
Location: Denmark
Contact:

Post by LSRasmussen »

Hello Rik,

Awsome details in that final image. I can see from your tech info that you've been using flash. What kind of shutter time did you use ?

Got a long way to go !! ;-)

//Lars

rjlittlefield
Site Admin
Posts: 23561
Joined: Tue Aug 01, 2006 8:34 am
Location: Richland, Washington State, USA
Contact:

Post by rjlittlefield »

Lars,

The short answer to your question is this: 1/200 second shutter, flash at 1/4 power, so probably about 1/4000 second, 1 second mirror lockup delay, flash triggered on shutter opening (1st curtain).

But there's actually a long story behind this picture, and it's worth talking through.

I believe this is the first stack that I have ever shot with flash and posted.

Generally I don't like flash because (a) it's difficult for me to get exactly the lighting I want, and (b) my flash varies a little from frame to frame (even though it's set on manual) and I don't trust the software to handle this properly.

So normally I use continuous illumination from a halogen base unit feeding a dual fiber head. That makes it easy to see what I'm getting and adjust to get what I want. The particular unit I have is very stable from frame to frame, so this approach kills both problems (a) and (b) that I have with flash.

However, continuous illumination is much more vulnerable to vibration, and at high magnifications any vibration at all becomes quite visible. At 10:1, less than 1 micron movement smears detail across more than one pixel!

Normally I handle this by using a long shutter time, around 1 second. Everything in my rig is hard-mounted, so vibrations are fast but die out quickly. Exposing at 1 second (plus a 1-second mirror lockup before exposure begins) is normally enough to make almost all the exposure occur during quiet time, so the image is sharp.

For this image, however, I did not want to use quite my normal setup. My normal setup is landscape orientation; this one is portrait.

That apparently small difference -- turning the camera 90 degrees -- turns out to have a huge effect. Using my standard lighting and exposure, my images were very blurred. Why would that be? I believe it's due to the difference in direction of vibration. The mirror and shutter on my camera move vertically. In portrait orientation, that corresponds to a direction where my mechanics are very rigid. But in landscape orientation, the vibrations are in a different direction, where my mechanics are probably 10X less rigid. In any event, the overall effect was that 1 second exposure was not nearly long enough to get crisp images.

I was unwilling to use an even longer exposure, so I decided to try flash instead despite the usual problems. Sure enough, I don't much like the lighting and different frames have different exposures, but on the other hand the details were crystal clear.

I wanted to use 2nd curtain sync, flashing after the shutter had been open for a full second or so. But it turns out that although the hacked firmware on my Canon 300D lets me set 2nd curtain sync, it doesn't actually work. The flash was always 1st curtain no matter what I set. That being the case, there was no advantage to using a long shutter, so I went the other direction and cranked the shutter down to the minimum that syncs with flash. That simplified the shooting by letting me turn on the room lights and also use just enough halogen fiber illumination to see the subject and monitor the stack by eye.

So there you have it. Yes, this stack was shot with flash, but flash is not my usual process and I probably won't switch over to it until/unless I get some different flash units.

I hope this discussion is helpful. It's the usual story -- there are lots of tradeoffs, and you have to figure out what works for what you want to do.

--Rik

lauriek
Posts: 2402
Joined: Sun Nov 25, 2007 6:57 am
Location: South East UK
Contact:

Post by lauriek »

I do shoot my stacks with flash as I don't have any constant illumination I can use as yet, although I am keeping an eye on ebay looking for a reasonably priced fibre optic rig...

I also find that the flash intensity varies a little from shot to shot, and I use a dedicated macro twinflash rig in fully manual mode. I suspect this will be the case with all flashes but I don't know for sure why - possibly because these flashes are made to a price point and it's difficult to control the output duration/power to the necessary degree and sell the flashgun at a sensible price. I certainly never noticed the issue before I started stacking, it's not a large difference in output...

ETA. Incidentally, Welcome Lars! This is certainly the place to be if you are into high-mag stacking... ;)

lauriek
Posts: 2402
Joined: Sun Nov 25, 2007 6:57 am
Location: South East UK
Contact:

Post by lauriek »

Rik, thanks for the work on this - this is an idea I've tried to use to get around stacking issues before, but it didn't really help with haloing - but it certainly seems to help with this, so I will definitely go back and try the technique out again soon!

Hope the authors add some sort of batch processing to Tufuse soon! :)

acerola
Posts: 251
Joined: Wed Dec 13, 2006 2:28 pm
Location: Hungary
Contact:

Post by acerola »

Wow, the details are perfect. You mentioned this technique before, so I used it. But a good example is always better. It is interesting, that the second picture has more contrast. Is it tufuse creating better pictures with shorter stack or just post processing?
Péter

rjlittlefield
Site Admin
Posts: 23561
Joined: Tue Aug 01, 2006 8:34 am
Location: Richland, Washington State, USA
Contact:

Post by rjlittlefield »

acerola wrote:It is interesting, that the second picture has more contrast. Is it tufuse creating better pictures with shorter stack or just post processing?
TuFuse creates better pictures with shorter stacks -- where "better" means that contrast/brightness are more like the in-focus pieces of the original frames.

Consider the limiting case: if you run a single frame through TuFuse, what comes out is just what went in. If you run two adjacent frames through TuFuse, what comes out has overall contrast and brightness very similar to what went in, but the details are merged. The more frames you run through at once, the more each pixel in the result is affected by overall differences in contrast & brightness due to the influence of varying OOF regions across all the frames. If you run through 50 or 100 frames at once, overall contrast will likely degrade while local contrast gets increased.

The depth-map and weighted-average algorithms currently used by CombineZM and Helicon Focus do not have this difficulty, since grossly OOF contributions are simply ignored.

This suggests that some sort of hybrid algorithm might work well -- use the multiresolution pyramid approach to merge details, but only from those images that plausibly contain details at each pixel position.

Developers may be working on this, but probably it will take a while to get the details right. After all, TuFuse traces its ancestry back to work done over 20 years ago.

But if you want to play with this idea in the meantime, you might consider something like this: Break your image into multiple overlapping slabs, say images 1-15, 8-22, 15-29, and so on. Run TuFuse on each slab independently. This will merge details within the slab without changing the overall brightness/contrast very much. Take the resulting images and feed them into CZ or HF to do the final merging, which will again be done without changing overall brightness & contrast very much.

This approach avoids some of the disadvantages of TuFuse, while at the same time retaining some of its important advantages. In particular many of the standard artifacts such as halo, lost bristles, and depth-map "swirly" effects can be significantly reduced or eliminated.

Shown below is an example of what can be made to come out. I choose these words carefully because I had to do quite a bit of playing around to get good parameter values. This is bleeding edge stuff and I don't recommend it yet, but I thought you'd be interested.

This is from TuFuse'ing groups of 15 frames with an overlap of 8 frames, then running CombineZM with a Do Stack macro modified to eliminate alignment, Find Detail 100,3,0, and skip the final sharpening and contrast adjustment. The result matches pretty closely what I see in the in-focus portions of individual images.

This image has had no manual editing, and post-processing is limited to levels adjustment and last-minute sharpening. I see some harsh halos around one antenna and around a few bristles near the top of the head. There is a small swirly transparency defect on one antenna, and a "flash" test shows that one bristle on a mandible got lost. But overall, this looks pretty good to me. ("Pretty good" is a moving target, of course. Four years ago this quality would have been jaw-dropping. :shock: )

--Rik

Image

rjlittlefield
Site Admin
Posts: 23561
Joined: Tue Aug 01, 2006 8:34 am
Location: Richland, Washington State, USA
Contact:

Post by rjlittlefield »

Here is another comparison that you may find interesting.

On the left is what comes from letting TuFuse handle all the frames at once (with a manual correction for the transparency artifact).

On the right is what comes from processing slabs of 15 frames in TuFuse, then doing the final merge with a modified CombineZM Do Stack as described above.

I have done a level adjust to match overall brightness as closely as I could do easily. I see I accidentally introduced a bit of color difference in that process too.

What I find most interesting in these two images is the obvious difference in handling of the extremely OOF background. TuFuse does a much better of identifying and preserving what "detail" there is in that area, despite its extreme fuzziness. This behavior is a nice feature of the pyramid algorithms, which essentially look for information at all scales simultaneously.

The light-colored diagonal stripe just under the mandibles is a legitimate feature, by the way. To keep the legs away from the head, I strapped them down with a strand of dental floss. I'm talking here about one of the micro-strands, diameter about 20 microns. You're seeing it here quite OOF, obviously. :)

--Rik

Image

augusthouse
Posts: 1195
Joined: Sat Sep 16, 2006 1:39 am
Location: New South Wales Australia

Post by augusthouse »

That's an interesting comparison Rik! Excellent contrast and detail!

So there is no additional Photoshop compositing going on - as indicated in the initial post when using the TuFuse slab stack approach ?

Craig
To use a classic quote from 'Antz' - "I almost know exactly what I'm doing!"

rjlittlefield
Site Admin
Posts: 23561
Joined: Tue Aug 01, 2006 8:34 am
Location: Richland, Washington State, USA
Contact:

Post by rjlittlefield »

So there is no additional Photoshop compositing going on - as indicated in the initial post when using the TuFuse slab stack approach ?
Correct. In the large image two posts above here, the one generated with numerous 15-frame slabs, I did no manual editing of the pixels. The lack of transparency in that case is due to the combination that (a) on average the antennae have somewhat stronger detail than the face behind them, and (b) I was able to tune the Find Detail parameters to lock onto the antenna detail and ignore the face. The tuning was time-consuming and undoubtedly specific to this image. In other cases, I expect it would be necessary (or at least faster!) to manually edit the merging of various slabs, similar to the foreground/background two-slab approach used in the initial post.

--Rik

acerola
Posts: 251
Joined: Wed Dec 13, 2006 2:28 pm
Location: Hungary
Contact:

Post by acerola »

I like the crispness of the second image. I will play around with it, if I have time. Rik, that's an excellent example again. Thanks
Péter

Post Reply Previous topicNext topic