4
$\begingroup$

enter image description here

I want to analysis the pattern of this kind of grid of cage, and remove them in frequency domain.

The goal image is like that shown by imgFinal, it's not an Inpaint task.

img=Import@"https://i.sstatic.net/heQBg.png";

One way is doing image segmentation with traditional method, we can do that for a better or perfect mask.

The goal I want to know is how to find out this pattern [grid/fence] part in frequency domain, like Fourier or Wavelet, the best result is remove the foreground grid, but keep dogs and background.

And then, we can remove them by lowpass or highpass filters or other special filters like that in a noise removing task in Frequency Domain.

It's better to find a simple way.

If it's too hard, training method is also acceptable, not neural network's training, but training the basis like traditional face recognition based on PCA.

Of course, maybe we can also use the images or features from some neural networks as basis, that's the last choice.

Here is an example about Image Denoise based on Fourier

enter image description here

enter image description here

$\endgroup$
2

1 Answer 1

3
$\begingroup$

Trying to separate out these fence by spectrum doesn't look easy:

img = RemoveAlphaChannel[
   Import["https://i.sstatic.net/heQBg.png"]];
shiftdata = 
  ResourceFunction["FourierShift"][
   Fourier[ImageData[ColorConvert[img, "Grayscale"]]]];
Manipulate[
 Image[Abs[
   InverseFourier[
    ResourceFunction["FourierShiftInverse"][
     shiftdata*
      ImageData[
       MaxDetect[ImageAdjust[Image[Abs[shiftdata]]], 
        thresold]]]]]], {thresold, 0.001, 0.045, 
  Appearance -> "Labeled"}]

enter image description here

$\endgroup$
1
  • 1
    $\begingroup$ If just get a mask of grid, and then use ImageMultiply with the original image is much easier, but do all things in frequency domain is not easy. Because, in space domain, we can use many filters more intuitively and visually, and we can also add some Morph manipulations to refine the results. $\endgroup$ Dec 5, 2022 at 5:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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