The ultimate weapon to deband CMOS sensors [Deep Sky] Processing techniques · blackrig · ... · 11 · 878 · 8

blackrig 6.20
...
· 
·  11 likes
·  Share link
In this post I present an easy to implement and extremely effective method to remove vertical (or horizontal) patterns, inherent to many modern CMOS sensors.
The processing is done using PixInsight, and makes use of masking in the Fourier domain.

First, let's take note of existing solutions, namely, in scripts: Utility>Canon Banding Reduction and Pattern Correction > Linear Pattern Subtraction. Also the WBPP script has an option to remove linear patterns. Unfortunately those 3 options have limited efficiency, at least in my experience. Further the WBPP Linear pattern removal is single threaded, and does slow down the script considerably.

The method proposed here is different:
We start with an image where the banding is visible, so, for all practical purposes,  in the non-linear domain. Ideally the image should also be starless.

We transform the image to the Fourier domain using PixInsight Fourier>Fourier Transform. We check the following options options: Centered and Power Spectrum.
This process applies in fact 2 Fourier transforms, one in the X direction and another one in the Y direction. The image is transformed from the XY domain to the FxFy domain.

We get 2 resulting images: the power spectrum and the phase. The power spectrum encodes the amplitudes in the image according to spatial frequency, while the phase encodes location of the amplitudes on the image. Keep the phase preciously and do not change it. It will be used for the inverse Fourier transform.
Now let's focus on the power spectrum.
It is a well known property of the Fourier transform that any horizontal banding in the XY domain will map as a vertical center line in the FxFy domain. This is simply because horizontal bands, if observed along the X axis, seem to have a zero spatial frequency.  Further, on this center vertical line low frequencies bands (in the Y direction) will map towards the center of the image, and high frequencies towards the top and bottom.

As an aside,  a vertical banding in the XY domain would map as a horizontal line in FxFy (for Canon users).

From there the debanding method is obvious: we use clone stamp to remove the vertical line in the center of the power spectrum image. We try to keep a natural smoothness and look to the power spectrum, but we do remove all the excess energy mapped on the central vertical line of the image.  We stay away from the central zone and focus more on the top and bottom of the central line. Clone stamping a power spectrum might feel un-natural, but you'll get a hang of it after just a few tries.

In passing: using a paint brush to blacken the corners of the power spectrum is a powerful denoise (removes high spatial frequency noise). Also slightly flattening the spectrum (with histogram) will boost details. 

Apply the clone brush changes to the power spectrum and execute Fourier > Inverse Fourier transform, using both the modified Power spectrum and the unmodified phase.

You get your image back, minus the banding. A simple Pixel Math subtraction between the original image and the image filtered in the Fourier transform will reveal only the banding has been remove. If you did it right there should be no signal leakage. 


Squid_debend.jpg

On the top image, the horizontal banding is clearly visible, on the bottom one, after DFT, masking and Inverse DFT it is completely gone.

DFT.png

On top the power spectrum form the banded image, bottom the power spectrum after being edited with the clone stamp to remove the central vertical line, which is where the horizontal banding noise is located in the FxFy domain.  This second image is also the power spectrum of the debanded image, and the one used in the inverse Fourier transform.


For the sake of completeness the following will also greatly help reduce banding using CMOS:

At Acquisition:
Make sure the images are properly exposed. Underexposed images will have more banding

During Image Calibration:
Do Bias and Flats at Gain 0.  Then substract the Bias from the Flats and discard the bias to create the master flats. Darks at the same gain as the lights. This simple trick (Flat at gain 0) can be very efficient.
Edited ...
Like
Herbert_West 4.72
...
· 
·  Share link
This is very clever!
Like
blackrig 6.20
Topic starter
...
· 
·  1 like
·  Share link
Here is another example of debanding on a marginally exposed, highly banded image (left) and spectral debanding right..lowsig3.jpg

On that example I blackened the corner with Rogelio's paintbrush (for spectral denoise purposes), and removed the central vertical line for debanding, using the clone stamp. Note that I stayed away from the center of the image, to avoid creating Gibbs artefacts at the top and bottom of the image.
lowsigsp.jpg
Like
Rostokko 1.51
...
· 
·  Share link
Seems to be a great target for a new AI based tool which automates the whole process… BandXTerminator anyone?
Like
spacetimepictures 4.82
...
· 
·  Share link
Wow that is clever and technical! Great job and thanks for sharing.
Like
jhayes_tucson 26.84
...
· 
·  1 like
·  Share link
This is a nice application of Fourier filtering.  It is exactly what was used in the early moon missions for removing artifacts from the scanning cameras used in early lunar satellites.  Have you compared your results with the CanonBandingReduction tool?

John
Like
OklahomAstro 5.08
...
· 
·  Share link
The true and new method of defeating banding is- Buying a new camerasmile
Like
blackrig 6.20
Topic starter
...
· 
·  Share link
Have you compared your results with the CanonBandingReduction tool?

Original, FK filter debanding, Canon Debanding script with highlight protection. Clearly the statistical method (Canon debanding) has difficulty switching from the target to the background but otherwise does a pretty good job.
fkvscanon2.jpg

fkvscanon.jpg
Like
blackrig 6.20
Topic starter
...
· 
·  1 like
·  Share link
The true and new method of defeating banding is- Buying a new camera

Unfortunately, this is a problem with the last iteration of sensors, maybe even more so than with the previous generation. The images above are from an IMX461.
Like
blackrig 6.20
Topic starter
...
· 
·  Share link
Here it is again on the full target, in order: original, Fourier filter, canon debanding script best effort.
fkvscanon3.jpg
Like
OklahomAstro 5.08
...
· 
·  Share link
The true and new method of defeating banding is- Buying a new camera

Unfortunately, this is a problem with the last iteration of sensors, maybe even more so than with the previous generation. The images above are from an IMX461.

Well, that is genuinely shocking to me. I've never seen banding in my newer cameras, only my old ones. Perhaps it's being rejected.
Like
blackrig 6.20
Topic starter
...
· 
·  1 like
·  Share link
Here she is, after being rescued by the Fourier FIltering in both Ha and OIII (was not necessary on SII). Squid.jpg
Like
 
Register or login to create to post a reply.