How can I prevent Zerene Stacker from resizing my images?

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

Moderators: rjlittlefield, ChrisR, Chris S., Pau

Dave_Anderson
Posts: 17
Joined: Sun Jul 17, 2011 12:26 am
Location: Sunnyvale, Ca.

How can I prevent Zerene Stacker from resizing my images?

Post by Dave_Anderson »

I am a bit into the trial period for Zerene stacker and I have noticed that Zerene does not give me the full FOV yet gives me the same size output image as the input(PMax). I was struggling to understand why my stacks look sharper when I run them through Photoshop's auto-align and auto-blend, and I think the upsizing being performed by Zerene is the culprit. Granted there are a lot of other problems with stacking in PS but when it finds a sharp region it stays sharp.

I looked for a setting for this but could not find anything obvious. Reading through the docs I found the reasons for general loss of contrast(UDR, etc.) and addressed that but thought there was still something wrong.

I would much rather have the actual pixels output even if I have to crop some garbage off of the edges. Is there a setting for this, and I'm just too dense to see it, or...?

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

Post by rjlittlefield »

Dave, hi! I'm the fellow who wrote Zerene Stacker (ZS), so I'm very interested in figuring out what's happening for you.

Here's a quick summary of what ZS does with default settings.

First, it compares the first and last images in your stack, identifies which one has the narrowest field of view, and if necessary reverses the order of the stack so as to put the narrow FOV first. The purpose of this is to reduce edge artifacts, which often result when portions of the output image are not covered by one or more input images. The check and reversal can be disabled by unchecking Options > Preferences > Alignment > Automatic order.

Then, it designates the first image in the stack as being the "master", against which all other images will be aligned. The alignment actually proceed incrementally. Image #2 is aligned against image #1 (the master). Then #3 is aligned against #2, #4 against #3, #5 against #4, and so on.

This alignment is done according to the settings in Options > Preferences > Alignment. Shift X, Shift Y, Scale, and Rotation are for geometry, while Brightness is for mean and variance of the luminance values. By default, all of these are enabled (check-marked). This gives good robustness against shifts of camera position and exposure, typical of slightly unstable rigs using automatic exposure. However, if the shooting setup physically prevents any particular type of misalignment, then generally it's better to disable that one. For example if you're shooting with continuous illumination and manual exposure, then it's probably better to disable Brightness because it's liable to do more harm than good, by attempting to correct variations that are actually due to changes in focus than exposure. Likewise if your setup physically prevents rotation, then you should uncheck Rotation.

Once the images are aligned, then the actual stacking happens. Here there is a fundamental difference between PMax and DMap. PMax is in the business of preserving maximum pixel-to-pixel variation, across all frames at each pixel position. DMap, in contrast, is in the business of looking at fairly large neighborhoods of pixels and identifying which individual frame (or pair of neighboring frames) should be used as a source of pixels. PMax is particularly adept at handling complicated structures with lots of overlap, and it hardly ever misses anything. On the downside, if there is any residual misalignment between frames, then PMax is likely to merge the details from both frames with a slight offset due to the misalignment. This produces a result that appears less sharp than either source image. DMap has complementary characteristics. It usually chooses pixels from just one source image, sometimes a weighted average of two. So, where DMap chooses the proper source image it faithfully preserves the sharpness and colors of that image (as resampled for alignment). That's the upside. On the downside, DMap sometimes makes mistakes about deciding which frame to use, which means that it's more likely to miss focused detail than PMax is.

The stacking method used by Photoshop is not the same as either PMax or DMap, but it's much more similar to DMap: select pixels from one or two frames in each neighborhood.

Both Photoshop and Zerene Stacker will resize/resample images as needed to make them align properly, so I doubt that resizing is responsible for the effect that you're seeing.

More likely, I think, is that due to perspective changes between frames there is a little residual alignment that is being turned into blur by PMax. I suggest trying DMap and seeing if that restores the sharpness you're missing. Be sure to read the tutorial on How To Use DMap, because some of its controls are not exactly intuitive.
I would much rather have the actual pixels output
Maybe, but that usually doesn't work as well as you might think. Unless you're working with high magnification microscope objectives or some other unusual optics like a telecentric lens system, then there are scale changes from frame to frame that have to be corrected in order for features to stay aligned properly. If you want to see what "actual pixels" looks like, then just uncheck everything at Options > Preferences > Alignment.

I hope this helps. Please follow up if you have further questions, which I expect you will have.

--Rik

stevekale
Posts: 172
Joined: Wed May 11, 2011 2:40 pm
Location: London, UK

Post by stevekale »

Rik

Can I ask a couple of questions here:

- so if Automatic Order in ZS is checked there is no garbage to trim from output images?

- presumably any manual flash setup on manual exposure (not just continuous illumination) would benefit from unchecking Brightness?

- is there any way in a controlled (breezeless, static subject, camera-on-rail) environment that Rotation could become a factor?

Regards

Steve

ChrisR
Site Admin
Posts: 8605
Joined: Sat Mar 14, 2009 3:58 am
Location: Near London, UK

Post by ChrisR »

As just-another-user I found on a stack recently that the perspective change through the stack made it process the right order through the stack, but misalignment in the stage meant that some "garbage" appeared on one edge.

Even with flash I use Brightness turned on, because I get the odd slightly dimmer image. As long as it's not the first image, ZS corrects it fine.

Rotation - yes, the camera can twist in a slightly sloppy bayonet. Some of those adapters from China... :roll: So get rid of the slop,. or the aligner can do funny things!

Dave_Anderson
Posts: 17
Joined: Sun Jul 17, 2011 12:26 am
Location: Sunnyvale, Ca.

Post by Dave_Anderson »

Thanks for the help. I'll have to go through my settings again after reading the above, and try DMap with a few different settings. The results that I was seeing with DMap were not of much use as I recall, at least not without a LOT of retouching. Unfortunately I'm pretty busy tonight but will find time for a couple of experiments at least... I dhould have more time to fiddle tomorrow.

My setup is not the most rigid but good enough that I don't get much misalignment so I think I disabled rotation and cut the shift values down to 5%. I'm having trouble moving in small enough steps but I have a modified microscope focuser in the works that should help -- but that's probably a few weeks out.

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

Post by rjlittlefield »

Steve, see ChrisR's answer. The point about bayonet rotation is particularly interesting. I have had stacks that started off in one orientation and then gradually shifted to another. I'm presuming that these were cases where the heavy side of the camera started off high and worked its way low under repeated shutter/mirror shocks.

Dave, keep me informed. I can give better advice if you'll post out some images showing the problems that you're having.

--Rik

Dave_Anderson
Posts: 17
Joined: Sun Jul 17, 2011 12:26 am
Location: Sunnyvale, Ca.

Post by Dave_Anderson »

Will do, I'll have to do that tonight after work though. The only thing I could show at this point is the PS output and the ZS output that I put a lot of effort into trying to fix -- I'd like to show the unadulterated output from both methods to illustrate the issue. Just before I left for work this morning I did get a PMax stack that looked much better having turned off brightness. This seemed to bring up macro detail(tones and shapes) quite a bit. I didn't have time to examine it closely though.

BTW alignment seems to be pretty good given what I'm working with -- trails from dust specks are not too convoluted.

ChrisR
Site Admin
Posts: 8605
Joined: Sat Mar 14, 2009 3:58 am
Location: Near London, UK

Post by ChrisR »

Rik wrote:Steve, see ChrisR's answer.
Glad to see I must be getting some things right :smt033

Chris S.
Site Admin
Posts: 3632
Joined: Sun Apr 05, 2009 9:55 pm
Location: Ohio, USA

Post by Chris S. »

stevekale wrote:Presumably any manual flash setup on manual exposure (not just continuous illumination) would benefit from unchecking Brightness?
Steve, you may want to inspect your images before doing this. I’ve found that manual flash on manual exposure can actually vary quite a from shot to shot. I suspect this is due to the capacitors not being fully charged, even though the ready light is on. In my experience, it can be managed by allowing extra time between exposures. Also, Eneloop batteries seem less prone to this than alkalines. Last night, I did several stacks of about 400 shots each, using a Nikon SB-800 running four Eneloops (changed out for fresh ones between stacks). The flash was set at 1/64 power, and the ready light came back one very quickly after each shot (something under a second, but I didn’t time it.) I rested the rig about 15 seconds between each shot—both to assure full capacitor charging, and to let heat dissipate. Across these hundreds of exposures, there was never enough variation to notice. If I’d been shooting at full power, I’d have allowed a longer delay between shots.

ChrisR wrote: Rotation - yes, the camera can twist in a slightly sloppy bayonet. Some of those adapters from China... :roll: So get rid of the slop. . . .
rjlittlefield wrote:The point about bayonet rotation is particularly interesting. I have had stacks that started off in one orientation and then gradually shifted to another.
I’ve seen this rotation slop, too. On my horizontal rig, it can manifest itself as a random back and forth motion.

My adapter is not a no-name one, but I do intend to swap it out for another. Further, I’ve decided that the camera should be firmly clamped to the tube lens or bellows, and should not depend on the bayonet. So am sketching up something to do this, yet be quickly adjustable for different camera bodies. (Chris R., I sure could use a small, high quality vertical translation stage for this. . . . ;))

In the meantime, simply pulling the camera to one side of its rotation slop, and placing it under load with a springy piece of surgical tubing, is working well.

stevekale
Posts: 172
Joined: Wed May 11, 2011 2:40 pm
Location: London, UK

Post by stevekale »

In my trials I was using 3 seconds after rail movement and another 3 seconds after mirror lock (after I noticed the flash not firing at one point). Images seem fine. Canon 580EX (new alkaline batteries). Sitting on a Stackshot. Lenses obviously attached to the camera body in conventional fashion.

I don't follow what you mean by rotation slop.

ChrisR
Site Admin
Posts: 8605
Joined: Sat Mar 14, 2009 3:58 am
Location: Near London, UK

Post by ChrisR »

I don't follow what you mean by rotation slop.
The same rotation you use to remove the lens from the camera. Manufacturers' original fittings are generally quite good, but "we" can use rather a lot of adapters and rings and bellows beween camera and lens. Some of those may "give " a few microns after a hundred shutter-firings. I mount a body on a stack of rings on top of a microscope arm. I know there's some play in there.

My newish Canon is slightly looser that my older Nikon D700.
My Nikon F2's a bit worn, though ;)

Chris S.
Site Admin
Posts: 3632
Joined: Sun Apr 05, 2009 9:55 pm
Location: Ohio, USA

Post by Chris S. »

Hey, Steve,
stevekale wrote:In my trials I was using 3 seconds after rail movement and another 3 seconds after mirror lock (after I noticed the flash not firing at one point). Images seem fine. Canon 580EX (new alkaline batteries).
Since you've checked to see that your images have consistent exposure, you probably can and should uncheck "Brightness."

I'd be concerned about extending this to "any manual flash setup on manual exposure"--since this often results in significant exposure variation from shot to shot.

My own protocol is probably overkill. But overkill simply works my rig longer, while I do something else, and maximizes predictability, which I find to be of value. Also, I like to keep my rechargeable batteries cool, which may prolong their lives. Keeping the flash cool may or may not have benefit, but a longer rest between shots helps with this.

Chris R. has explained "rotation slop" very well. This may be a new term we are coining, here. But it's a notable problem, and bringing it to the fore and giving it name is probably a good thing.

Cheers,

--Chris

Dave_Anderson
Posts: 17
Joined: Sun Jul 17, 2011 12:26 am
Location: Sunnyvale, Ca.

Post by Dave_Anderson »

OK, here is the unaltered Zerene output:

Image
Full-size should be here.

Here is the unaltered PS output:

Image
Full-size should be here.

The above was the state of affairs when I first posted. The PMax with brightness comp on flattens right out and the detail in the light areas is just gone. The PS file crops down to about the same FOV as the PMax file, but ends up being ~5200 pixels on the long side as opposed to the 6048 seen with Zerene. The PS file also looks much more "alive" and "3D". Clearly I had mistaken the cause of the poor output.

Now, to be fair, this rig is very rickety and poorly matched for the lens. I'm shooting with a Minolta 12.5 f/2 so my DOF is very thin, and the aged Vivitar bellows doesn't have a very good focus rail... I can't get consistent small steps like I want and that is very evident in the above pics(and those below, for that matter). Not to worry, I have a rig under construction that will give me 100 1μ increments/rev on the knob. Just playing for now, finding issues with lighting, internal flare, etc. and solving them while having fun.

I went back and shut off the last setting likely to be a factor here, the brightness comp. and I'm much happier with the result:

Image
Full-size should be here.

Here it is with a bit of curve-pulling and color correction:
Image

Despite how poorly this was shot I can see that I'm moving in a good direction and that is enough for now.

It's a very tricky subject and really calls for much better diffusion; I'm using a plain Minolta ringflash with two tubes active. I'm planning to add a ping-ping ball with light guides to this setup soon to see how it works out. All part of the process of exploration, eh? :)

Speaking of which, this is a very nice feature:
Image

If anyone is curious about what we're looking at here, it's a strike-anywhere kitchen match. Here is the "before" pic of the same part of the match, prior to my MKII flare-control solution. :)
Image

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

Post by rjlittlefield »

Dave, I'm glad to see you're making progress.

Reading between the lines, I'm guessing that your first image is pretty low contrast because it's mostly out-of-focus, so what's happening is that Brightness adjustment is making all your other frames equally low contrast in an attempt to "correct" for a problem that isn't there. There's a FAQ item that dances around this issue. I'll update it to be more explicit. Thanks for the feedback.

Nice job on the rocking display!

--Rik

Dave_Anderson
Posts: 17
Joined: Sun Jul 17, 2011 12:26 am
Location: Sunnyvale, Ca.

Post by Dave_Anderson »

Yes, I'm definitely having problems getting the areas of sharp focus to overlap. I have a 2" lever clamped to the knob on the focus rail and I still can't get fine enough movement.

I leave the speculation of what your software thinks it's doing to you, I obviously am better off sticking to observations more than causes. :lol: Thanks for offering your perspective!

Post Reply Previous topicNext topic