title: Assertion failed (anchor.inside(Rect(0,0,ksize.width,ksize.height))) in cv::normalizeAnchor) when using custom anchorPoint in OpenCV C++
body: <p>i 'm trying to use filter2D function. There is no error when i use anchor point from -1 to 2 (e.g Point(1,-1), Point(0,0), Point(1,2)...). But when i try to input anchor point at bottom right of kernel matrix (Point(2,-2)) and i get error. Can u guys help me. Thank you.</p>
  <pre><code>   #include &quot;opencv2/core.hpp&quot;
     #include &quot;opencv2/highgui.hpp&quot;
     #include &quot;opencv2/imgproc.hpp&quot;
     #include &lt;opencv2/highgui/highgui_c.h&gt;
     #include&lt;stdlib.h&gt;
     #include&lt;stdio.h&gt;
     #include&lt;math.h&gt;
     #include &lt;iostream&gt;
     using namespace cv;
     using namespace std;
     
     
     int main(int argc, char const* argv[])
     {
         float data1[4][4] = { 1,2,3,3,8,1,10,11,15,16,9,18,1,23,24,25 };
         Mat input = Mat(4, 4, CV_32F, data1);
         cout &lt;&lt; &quot;Original Matrix = &quot; &lt;&lt; endl &lt;&lt; &quot;&quot; &lt;&lt; input &lt;&lt; endl &lt;&lt; endl;
     
         float data2[3][3] = { 9,8,7,6,5,4,3,2,1 };
         Mat kernel = Mat(3, 3, CV_32F, data2);
         cout &lt;&lt; &quot;Kernel = &quot; &lt;&lt; endl &lt;&lt; &quot;&quot; &lt;&lt; kernel &lt;&lt; endl &lt;&lt; endl;
     
         Mat output;
         Mat output1;
         filter2D(input, output, input.depth(), kernel, Point(2,-2), 0, 0);
         //filter2D(input, output1, input.depth(), kernel, Point(1,-1), 0, 0);
         cout &lt;&lt; &quot;Output Matrix = &quot; &lt;&lt; endl &lt;&lt; &quot;&quot; &lt;&lt; output &lt;&lt; endl &lt;&lt; endl;
         //cout &lt;&lt; &quot;Output Matrix1 = &quot; &lt;&lt; endl &lt;&lt; &quot;&quot; &lt;&lt; output1 &lt;&lt; endl &lt;&lt; endl;
         waitKey(1);
         cin.get();
         return 0;
     }
  </code></pre>