5
$\begingroup$

I have a merged image containing 20 segments. When I concatenate them directly, I have obviously observable patches in the whole image. I want to get rid of them while distorting the original image as little as possible by using some sort of post-processing.

What I did first was to apply Gaussian and median filters. However, they did not work properly which was expected. And then I applied a low pass Butterworth filter (using skimage library) since the sudden changes in merging points of patches imply a high frequency component. Even though the resulting image looks decent enough, I have an issue that I would also like to solve. Patchy image (top), Post-processed image (bottom)

The main issue resides in the bottom part of the images. In the original patches, there are no high valued component at the bottom of the picture. However, when I post-process it via low-pass Butterworth, it seems that there is some sort of leakage from the top of the original patch to the bottom part. Is this due to periodic nature of frequency (fft) domain? In addition, how can I solve this issue without having the residuals in the bottom part?

enter image description here

$\endgroup$

1 Answer 1

5
$\begingroup$

What you see is indeed by either using filtration on the frequency domain which uses periodic boundary condition or by using is explicitly.

A better choice would be the replicate / nearest boundary condition.

in Python you may use scipy.ndimage.convolve() with mode = nearest.

Yet this will force you to extract the kernel you want as an array.
If you use SciKit Image then what you need to pad the image before applying the filter using numpy.pad() with mode = edge then apply the filter and crop.

$\endgroup$
1
  • $\begingroup$ Thank you for the answer, this is actually how I ended up doing. $\endgroup$
    – Avio
    Feb 27 at 13:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.