title: How to suppress OpenCV error message
body: <p>I am writing an OpenCV project using g++ and opencv 2.4.6</p>
  
  <p>I have some code like this:</p>
  
  <pre><code>try 
  {
      H = findHomography( obj, scene, CV_RANSAC );
  }
  catch (Exception &amp;e)
  {
      if (showOutput)
          cout&lt;&lt; "Error throwed when finding homography"&lt;&lt;endl;
      errorCount++;
      if (errorCount &gt;=10)
      {
          errorCount = 0;
          selected_temp = -99;
          foundBB = false;
          bb_x1 = 0;
          bb_x2 = 0;
          bb_y1 = 0;
          bb_y2 = 0;
      }
      return -1;
  }
  </code></pre>
  
  <p>Error will be thrown when the findHomography failed to find things. The error message includes:</p>
  
  <pre><code>OpenCV Error: Assertion failed (npoints &gt;= 0 &amp;&amp; points2.checkVector(2) 
  == npoints &amp;&amp; points1.type() == points2.type()) in findHomography, 
  file /Users/dji-mini/Downloads/opencv- 2.4.6/modules/calib3d/src/fundam.cpp, 
  line 1074
  OpenCV Error: Assertion failed (count &gt;= 4) in cvFindHomography, 
  file /Users/dji-mini/Downloads/opencv-2.4.6/modules/calib3d/src/fundam.cpp, line 235
  </code></pre>
  
  <p>Since I know under what conditions the message would appear, I want to suppress these error messages. But I don't know how to do it.</p>
  
  <p>In old version of OpenCV, there seems to have a "cvSetErrMode", which, according to other articles, is depreciated in OpenCV 2.X. 
  So what function can I use to suppress OpenCV error messages? </p>