Zerene Stacker now has dust & hot-pixel removal

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

Moderators: rjlittlefield, ChrisR, Chris S., Pau

Luisifer
Posts: 112
Joined: Wed Sep 05, 2018 1:40 am
Location: Czech Republic
Contact:

Post by Luisifer »

rjlittlefield wrote:I have thought about using the mask as a way of preventing edge streaks, by using a different dataflow. For that application, the filling would not get done before transformation. Instead, the mask would get transformed along with the image, so that the narrow black borders turn into large black regions, covering the areas that would otherwise be filled with edge streaks. Then in-filling those regions would result in smooth variations instead of edge streaks, and the stacking process would tend to replace those with real data from other frames.
Ok, now it is clear to me. That is what i was thinking of. I was confused from your previous text about dust edges.

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

Post by rjlittlefield »

OK, so I put in a new feature to avoid edge streaks by using the dust & defects mask as discussed above, by adding a black border to the mask and in-filling after alignment.

Image

Note that if you select this option, it's not required to have a mask image on file. The program will make an all-white mask internally if needed, before adding the black border.

Here's my usual demo with horrible streaks, due to processing a detailed image in wide-to-narrow order without the new feature:

Image

Here's the very same stack and processing, but with "Avoid edge streaks" selected.

Image

This is available in the current beta, T2020-04-04-1104-beta .

I hope this helps. Feedback solicited, of course.

--Rik

Luisifer
Posts: 112
Joined: Wed Sep 05, 2018 1:40 am
Location: Czech Republic
Contact:

Post by Luisifer »

looks good :-)

TheLostVertex
Posts: 317
Joined: Thu Sep 22, 2011 9:55 am
Location: Florida

Post by TheLostVertex »

I redid the stack I posted earlier in this thread with out rotation enabled after Rik's comment and there was some pretty bad streaking on the border, and some of the streaking crept into the "usable" parts of the image, compared to with rotation on. The streaking entering the detailed area is from a lot of up and down sag that was in my rig at the time of taking the picture
Image

I came back to this thread and saw the new feature and tried it on the same problem stack, and as I hoped it took out some of the edge streaking that entered the "usable" area. How ever I found an unexpected thing, the image is MUCH darker, plus a tiny change in alignment(no rotation or scaling on either). Both stacks were processed with the same settings except for the "Avoid edge streaks" option. The brightness option under alignment was on for both.

Image

So the next step is to turn brightness correction off(which I suppose I shouldnt have had on anyways for this stack). The the image is dark again, and the alignment has changed again. As a side note i think this one came out nicest so far.

Image

Interesting results with this troublesome stack :)

-Steve

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

Post by rjlittlefield »

Steven, those are certainly very interesting results.

At this moment I have no good idea what is going on with the brightness change.

If you're using PMax, then the average brightness of the final result should be equal to the average of all the source frames, after they are transformed for stacking. I can vaguely imagine that the smooth in-filling process has produced a different average value than the edge streaks would have had, which could push down the average of the final result. But I would expect that to make only a very minor change, much smaller than you're showing.

To debug this issue, I suggest to proceed as follows:
1. Be sure there is a check-mark on Options > Preferences > Caching & Undo > "Cache aligned screen images".
2. Start a new project containing just your source frames.
3. Process the stack as you did here, producing a dark result.
4. Place a checkmark on "Show as adjusted", at the top of the Input Files panel.
5. Press-and-drag within the Input Files panel, to scroll through the set of source files. You should see the source files as they existed just before stacking, after they were aligned, brightness corrected if any, and in-filled in the missing edge regions. By toggling the "Show as adjusted" checkmark, you can see source images before and after transformation.

If you can figure out what's going on, please let us know.

If you cannot figure out what's going on, then please contact me as support@zerenesystems.com to arrange getting me a copy of the stack, and I'll be happy to take a look at it.

Either way, I look forward to understanding your result.

--Rik

TheLostVertex
Posts: 317
Joined: Thu Sep 22, 2011 9:55 am
Location: Florida

Post by TheLostVertex »

When posting last night I complete forgot that I received an error during the stack. I forgot about it because the stack appeared to finish and there was quite a bit of time between the error popping up and me writing the post :roll:

The error is of course some what important.

Code: Select all

3677.136: Alignment failed due to NaNEncountered
This only happened in the stack with "Avoid edge streaks" enabled, and happens during image 403(important!). Another possible important thing is, this stack has a fairly large endemic alignment problem. So much so that many of the later images get aligned out of having much, if any detail to add to the final image. I am sure I knew that at the time I took it, but this is almost a 2 year old stack that I just happened to remember had a lot of easy to see dust.

Looking at the aligned images as suggested, the darkening problem is clear. A picture is worth a thousand words, in this case a video is worth about half a thousand photos...

Aligned images without "Avoid edge streaks" enabled, no error thrown.
https://streamable.com/pxrehn

Aligned images with "Avoid edge streaks" enabled, error is thrown on image 403.
https://streamable.com/ty0n51

So my take away so far:
1. I can cull the number of images for this stack by quite a bit due to alignment
2. There is some alignment error happening due to the border fill, causing the rest of the images to be aligned to oblivion.
3. This is likely weird edge case, no pun intended. A large amount of alignment is needed for this stack, and it has minimal detail through out the frame in the latter images.

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

Post by rjlittlefield »

Aligned images with "Avoid edge streaks" enabled, error is thrown on image 403.
https://streamable.com/ty0n51
OK, I know I have a quirky sense of humor, but watching that thing was about as much fun as a cat video! Nothing...nothing...nothing...LAUGHTER!

Here's the scoop on NaNEncountered, quoted from my reply to an earlier user who reported one to support@zerenesystems.com :
NaNEncountered is quite a rare condition.

I hear about a problem like this only about once per year, and almost always with a stack that has something weird with either exposure or framing. Back in late 2014, one was reported that traced back to several frames where the flash had misfired. There was one in April 2014 that traced to an honest-to-goodness coding error combined with a drifting fog bank that triggered an off-by-one limit check in brightness correction. Before that there was one in Aug 2013, triggered by a collection of images that wasn't really a stack at all but rather more like a side-by-side collection of images that one might consider doing a panorama stitch on. For 2012 and 2011, I can't find one. [likewise now for 2016 and 2017]

Background is that the alignment process is basically an organized sequence of tweak-and-test steps, each of which involves a huge amount of arithmetic that ends up using every pixel value. The generic NaNEncountered message means that someplace (anyplace) in that mess of arithmetic the code ended up dividing zero by zero and got "Not a Number" (NaN) as a result.

I suggest first to look through the stack frame by frame and see if there's something obviously wrong, such as a flash that didn't fire or a stray frame at front or end of stack.

If that doesn't solve the problem, then if it's feasible for you to send me the stack, say using DropBox, along with instructions to reproduce the failure, I would be interested to see if I can figure out what's going wrong in your case.

If sending the stack is not feasible, then I suggest going to Options > Preferences > Alignment and removing any checkmarks that don't apply to you. If your illumination is stable, uncheck Brightness. If your camera is mounted on a tripod so that it cannot rotate, then uncheck Rotation. With most 9-frame stacks, there will be some scale and shifts that need to be corrected, so for you I recommend to leave Scale, Shift X, and Shift Y checked.
The reply from that particular user was
You were right in your assessment of my problem. I found a blank frame where there had been a malfunction during shooting.
Stephen, according to my re-count just now, you are #13 on the NaNEncountered list. I started to send you the award for "Unlucky Number on an Unlucky List", but alas, it turned out that the award had been severely damaged in storage due to an unfortunate sequence of events far too long to recount here.

More seriously, NaNEncountered is such a rare problem that I've never put much time into figuring out how to improve its handling. Of course every occurrence raises its priority, but at 13 instances in 10 years it's still pretty far down the list of things to spend time on.

--Rik

TheLostVertex
Posts: 317
Joined: Thu Sep 22, 2011 9:55 am
Location: Florida

Post by TheLostVertex »

rjlittlefield wrote: Stephen, according to my re-count just now, you are #13 on the NaNEncountered list. I started to send you the award for "Unlucky Number on an Unlucky List", but alas, it turned out that the award had been severely damaged in storage due to an unfortunate sequence of events far too long to recount here.
That actually made me laugh. Im know for my unluckyness, so this is quite fitting. :lol:

At least I produced the error in a new way! 'Lets all look on the bright side of life...'

Post Reply Previous topicNext topic