title: OpenCV Mat rotation gets wrong result
body: <p>I want to rotate an image by 90 degrees. My code is like following:</p>
  
  <pre><code>int main(int argc, const char * argv[]) {
      Mat img = imread("/Users/chuanliu/Desktop/src4/p00.JPG");
  
      resize(img, img, Size(1024, 683));
      imwrite("/Users/chuanliu/Desktop/resize.jpg", img);
      Mat dst;
      Mat rot_mat = getRotationMatrix2D(Point(img.cols / 2.0, img.rows / 2.0), 90, 1);
      warpAffine(img, dst, rot_mat, Size(img.rows, img.cols));
  
      imwrite("/Users/chuanliu/Desktop/roatation.jpg", dst);
  
      return 0;
  }
  </code></pre>
  
  <p>But the result is like following:
  <br>Before rotation:<br>
  <img src="https://i.stack.imgur.com/5syfi.jpg" alt="enter image description here"></p>
  
  <p>After rotation:<br>
  <img src="https://i.stack.imgur.com/Drrro.jpg" alt="enter image description here"></p>
  
  <p>It seems that the center of rotation has sth wrong. But I don't think I set a wrong center. Is there anyone can tell me what is wrong?</p>