title: Error when applies an affine transformation to an image in opencv2
body: <p>I deskew image with warpAffine function in java, but when i run it notices:</p>
  
  <pre><code>OpenCV Error: Assertion failed ((M0.type() == CV_32F || M0.type() == CV_64F) &amp;&amp; M0.rows == 2 &amp;&amp; M0.cols == 3) in warpAffine
  </code></pre>
  
  <p>This is my function:</p>
  
  <pre><code>private  Mat deskew(Mat image,boolean negated){
          if(!negated) {
              for (int row = 0; row &lt; image.rows(); row++) {
                  for (int col = 0; col &lt; image.cols(); col++) {
                      double value = 255 - image.get(row, col)[0];
                      image.put(row, col, value);
                  }
              }
          }
          Moments m = Imgproc.moments(image);
          if(Math.abs(m.get_m02()) &lt; 1e-2) {
              return image;
          }
          double skew = m.get_m11() / m.get_m02();
          int rows = 2,cols = 3;
          Size size = new Size(rows,cols);
  
          Mat M = new Mat(size,CvType.CV_32F);
          M.put(0, 0, 1.0);
          M.put(0, 1, skew);
          M.put(0, 2, -0.5*image.rows()*skew);
          M.put(1, 0, 0.0);
          M.put(1, 1, 1.0);
          M.put(1, 2, 0.0);
          Mat imagedst = new Mat();
          Imgproc.warpAffine(image, imagedst, M, image.size(),Imgproc.WARP_INVERSE_MAP|Imgproc.INTER_LINEAR);
          return imagedst;
      }
  </code></pre>
  
  <p>I think when i initialize Mat M with CvType.CV_32F type is wrong. </p>