I am applying a low-pass filter to X ray images, which changes the pixel distribution such that the background goes from black to gray. In the attached figure, this amounts to the mode increasing from 0 to 50. I want to postprocess the filtered images to have a black background, while minimizing additional information loss. One idea I have is to compute the mode of the filtered image, then reduce the brightness of the image by this amount. Is there a less ad-hoc way of achieving my goal?
Here is my procedure for low-pass filtering:
- Apply DFT to the input image
- Shift DC component to the center
- Apply a radial filter, setting all frequencies outside of radius $r$ from the center to zero
- Inverse shift
- Inverse DFT
- Normalize pixel values to be in $[0, 1]$
