4

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.stack.imgur.com/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

HyperGroups
  • 8,619
  • 1
  • 26
  • 63

1 Answers1

3

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

img = RemoveAlphaChannel[
   Import["https://i.stack.imgur.com/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

yode
  • 26,686
  • 4
  • 62
  • 167
  • 1
    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. – HyperGroups Dec 05 '22 at 05:43