How do you scale the intensity of a Fourier filtered image?

1 visualizzazione (ultimi 30 giorni)
This seems so trivial, but I can't figure out the answer.
Let's say I have some image and zero out two quadrants of the FFT2 in order to focus on image information oriented in a certain direction. I then take the inverse FFT2. If I just add back the original DC term, I notice that the intensity of my objects is not what it should be (depending on the example... allow me to illustrate).
For example, imagine that the image is a sine wave oriented at 45 degrees with amplitude of 1 and DC of 2 (range of this function will be 1 to 3). This is superimposed on another sine wave at 135 degrees with amplitude of 3 and DC of 4 (range of this function will be 1 to 7). The overall image DC is 3 (average of 2 and 4).
If I IFFT2 in one direction and add back the 3 (DC), for the 45 degree direction I will have a range of 2 to 4 (i.e. the peaks are now 1 unit higher than they were in the original image), and if I did it for the 135 degree direction I would have a range of 0 to 6 (i.e. the peaks are now 1 unit lower than in the original image).
Clearly if I wanted to solve this problem I would need to adjust the DC to add to each image individually... but I can't seem to figure out a good way to do it. I've tried scaling by the amplitude and energy of the filtered data but appear to be missing something.
Any clues??
PS The reason I want to keep the image scales the same is that I have determined a threshold from the overall image, but need to apply the same threshold to the filtered images (if that helps at all...).

Risposte (0)

Prodotti

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by