title: Image smoothing in R
body: <p>How can I smooth this picture in R, so that only two peaks remain?</p>
  
  <p>If this would be 1d data, I would do a running mean or fit a regression function to it. But I did not find very specific information about applying these methods on a 2d matrix. For example I tried to use <code>filter()</code> from the <code>stats</code> package. </p>
  
  <p>I also thought about kriging, but this is more about interpolation, is it?</p>
  
  <p><img src="https://i.stack.imgur.com/ZchOe.jpg" alt="spectrogram"></p>