Problem with median filtering
Posted: Mon Aug 10, 2020 7:57 pm
After reading Christians excellent article on echelle optimization I started to use 3x3 median filtering in my data reduction pipeline as I am using an ASI1600m cmos sensor on my echelle.
However, I think I have uncovered a problem with median filtering that may be quite general and not just specific to my setup.
The following image is a portion of order 33 processed with median filtering applied after image calibration, before binning 2x2. This shows ripple that looks like an interference effect, but I had not changed my instrument in any way and I did not have this before.
After processing again without the 3x3 median filter I got the following result - normal with no ripple One can actually see the problem in the spectral image if you look closely. Here is a portion of the image after calibration but before median filtering. and after a 3x3 median filter. The ripple is hard to see but becomes more obvious with histogram stretching. The ripple induced from applying a 5x5 median filter is obvious even without histogram stretching. I used both MaximDL and PixInsight to apply the median filters. Both gave the same result.
I think the problem lies with the way a 3x3 median filter resamples a pixilated image, particularly curved and sloping lines. It appears not to be geometrically neutral.
3x3 or 5x5 average filtering does not produce this problem. Of course this is not useful for reducing the random cmos telegraph noise.
Here is the spectrum with 5x5 average filtering applied. So , while median filtering is excellent for reducing cmos telegraph noise it can also lead to spurious artifacts.
How obvious these artifacts are will probably depend on how diffuse the lines on the spectral image are.
In my case they were unacceptable.
However, I think I have uncovered a problem with median filtering that may be quite general and not just specific to my setup.
The following image is a portion of order 33 processed with median filtering applied after image calibration, before binning 2x2. This shows ripple that looks like an interference effect, but I had not changed my instrument in any way and I did not have this before.
After processing again without the 3x3 median filter I got the following result - normal with no ripple One can actually see the problem in the spectral image if you look closely. Here is a portion of the image after calibration but before median filtering. and after a 3x3 median filter. The ripple is hard to see but becomes more obvious with histogram stretching. The ripple induced from applying a 5x5 median filter is obvious even without histogram stretching. I used both MaximDL and PixInsight to apply the median filters. Both gave the same result.
I think the problem lies with the way a 3x3 median filter resamples a pixilated image, particularly curved and sloping lines. It appears not to be geometrically neutral.
3x3 or 5x5 average filtering does not produce this problem. Of course this is not useful for reducing the random cmos telegraph noise.
Here is the spectrum with 5x5 average filtering applied. So , while median filtering is excellent for reducing cmos telegraph noise it can also lead to spurious artifacts.
How obvious these artifacts are will probably depend on how diffuse the lines on the spectral image are.
In my case they were unacceptable.