title: Band-Stop Filter mask based on low/high pass filter mask OpenCV
body: <p>I am looking for the way to combine images below:
  <img src="https://i.stack.imgur.com/63j8e.png" alt="enter image description here">
  <img src="https://i.stack.imgur.com/pOaRp.png" alt="enter image description here"></p>
  
  <p>into image like:</p>
  
  <p><img src="https://i.stack.imgur.com/kG9jI.png" alt="enter image description here"></p>
  
  <p>What I am doing is trying to make band stop filter with masks from butterworth low/high pass filters.
  If there is no way to merge masks like that I will post my butterworth code so maybe you could help me re-implement it to do the work:</p>
  
  <pre><code>void Processing::lowhighpass_filter(cv::Mat &amp;dft_Filter, int D, int n, bool highpass)
  {
      dft_Filter = cv::Mat(dft_Filter.rows,dft_Filter.cols,CV_32F,cv::Scalar::all(0));
  
      cv::Point centre = cv::Point(dft_Filter.rows / 2, dft_Filter.cols / 2);
      double radius;
  
      // based on the forumla in the IP notes (p. 130 of 2009/10 version)
      for(int i = 0; i &lt; dft_Filter.rows; i++)
      {
          for(int j = 0; j &lt; dft_Filter.cols; j++)
          {
              radius = (double) std::sqrt(std::pow((i - centre.x), 2.0) + std::pow((double) (j - centre.y), 2.0));
              dft_Filter.at&lt;float&gt;(i,j) = (float) ( 1 / (1 + std::pow((double) (radius /  D),   (double) (2 * n))));
          }
      }
  
      if (highpass)
      {
          dft_Filter = cv::Scalar::all(1) - dft_Filter;
          //cv::imshow("highpass_filter", dft_Filter);
      }
  
      cv::Mat toMerge[] = {dft_Filter, dft_Filter};
      cv::merge(toMerge, 2, dft_Filter);
  }
  </code></pre>
  
  <p>I need to create the mask like on the third image, possibly with modifiable radius of inner and outer circle. Any clues?</p>