opencv旋转图像,90度标准旋转

摘自opencv 源代码

 

void rotate(InputArray _src, OutputArray _dst, int rotateMode)
{
    CV_Assert(_src.dims() <= 2);

    CV_OCL_RUN(_dst.isUMat(), ocl_rotate(_src, _dst, rotateMode))

    switch (rotateMode)
    {
    case ROTATE_90_CLOCKWISE:
        transpose(_src, _dst);
        flip(_dst, _dst, 1);
        break;
    case ROTATE_180:
        flip(_src, _dst, -1);
        break;
    case ROTATE_90_COUNTERCLOCKWISE:
        transpose(_src, _dst);
        flip(_dst, _dst, 0);
        break;
    default:
        break;
    }
}

  

 

posted @ 2018-08-17 14:47  路边的十元钱硬币  阅读(1352)  评论(0编辑  收藏  举报