aihot  2017-05-16 15:06:39  OpenCV |   查看评论   
    fbc::Mat_<uchar, 3> matTranspose(width, height);  
  •     fbc::transpose(mat1, matTranspose);  
  •   
  •     // 顺时针旋转90度
  •     fbc::Mat_<uchar, 3> matRotate90(width, height);  
  •     fbc::flip(matTranspose, matRotate90, 1);  
  •     cv::Mat tmp2(width, height, CV_8UC3, matRotate90.data);  
  •     cv::imwrite("E:/GitCode/OpenCV_Test/test_images/rotate_90.jpg", tmp2);  
  •   
  •     // 顺时针旋转180度
  •     fbc::Mat_<uchar, 3> matRotate180(height, width);  
  •     fbc::flip(mat1, matRotate180, -1);  
  •     cv::Mat tmp3(height, width, CV_8UC3, matRotate180.data);  
  •     cv::imwrite("E:/GitCode/OpenCV_Test/test_images/rotate_180.jpg", tmp3);  
  •   
  •     // 顺时针旋转270
  •     fbc::Mat_<uchar, 3> matRotate270(width, height);  
  •     fbc::flip(matTranspose, matRotate270, 0);  
  •     cv::Mat tmp4(matTranspose.rows, matTranspose.cols, CV_8UC3, matRotate270.data);  
  •     cv::imwrite("E:/GitCode/OpenCV_Test/test_images/rotate_270.jpg", tmp4);  
  •   
  •     return 0;  
  • }  
  •  

    除特别注明外,本站所有文章均为 赢咖4注册 原创,转载请注明出处来自通过transpose和flip实现图像旋转90/180/270度

    留言与评论(共有 0 条评论)
       
    验证码:
    [lianlun]1[/lianlun]