Phil commented on my website with this question and I responded there, but I thought it might be useful to post that same response here.
Here were Phil's questions:
1. Would you recommend this only for use on debayered subs?
2. Is there a way to tune the hot pixel removal from the PixelMath expression? The “f=9.0” looks like the place I could try perhaps?
3. Is there a way of running this multiple times automatically do you think?
And here is my answer:
1) Yes, the subs would need to be debayered first. This is because, while Bayered, the intensity at each adjacent pixel may be very different due to the filter transmission and brightness of the object in each portion of the spectrum that the filter allows through (this is why with Bayered monochrome data you may see some pixels as much darker than others when zoomed in). The expression could be modified to work on a Bayered image but it would be difficult and easier to do with a script or process.
2) Yep, the f=9.0 symbol is essential a sigma multiplication factor. It isn’t exactly a sigma value because I’m using a biweight midvariance function instead of standard deviation, but it works effectively the same way. Smaller values will mark more pixels as hot or cold and replace them with surrounding data, so they are more aggressive but they also have a higher chance or removing real data, like star peaks.
3) If you bring up the ProcessContainer you can drag the ‘new instance’ icon from the PixelMath window into it 5 or more times. When that ProcessContainer is applied to your image it will run that PixelMath expression however many times you added it in. You can save that ProcessContainer off, just like the PixelMath process, so it can be used whenever you want.
I will say that when I created some of these PixelMath expressions, tools like CosmeticCorrection did not exist. The ‘Use Auto detect’ option does essentially this same thing. It does use standard deviation rather than bwmv which is not as robust but still works well. It also only works in a global capacity on files, so you can’t run it on a single image or use the ProcessContainer method I described above to run it in multiple passes. It does however handle Bayered data (the CFA option – which stands for color filter array).
The reason why your hot pixels cover more than one pixel is that debayering uses an interpolation process (when using bilinear or VNG) to determine what the color is at each pixel location. Since a hot pixel's 'signal' is typically very strong relative to the rest of the image the color associated with that hot pixel is spread across the surrounding pixels.
Tools like CosmeticCorrection and DefectMap, which are CFA aware, can operate on the the Bayered data knowing that the filters are arranged in a 4x4 pixel pattern to correctly determine what the sigma is and what the replacement value should be.
Regards,
David