循环图像旋转在opencv中做什么是最好的方法 [英] round robin image rotation what is the best way to do in opencv

查看:220
本文介绍了循环图像旋转在opencv中做什么是最好的方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想进行循环图像旋转,如下所示。

I want to do a round robin image rotation as shown below.

x垂直线来自图像的开头被删除并添加到图像的末尾。

The x vertical line from the start of image is removed and added to the end of image.

在OpenCV,GDI ++和WPF中执行此操作的最佳方法是什么?我需要为这些平台中的每一个提供解决方案,但它们可以以不同的方式实现。

What is the best way to do this in OpenCV, GDI++ and WPF? I need a solution for each of these platform but they could be implemented differently.

我需要在具有以下签名的函数中实现它(对于opencv)

I need to implement it in a function with the following signature(for opencv)

  Mat CircShift(Mat inputImage, int PixelInXdirectionToShift);

我知道如何通过操纵像素来做到这一点,但我正在寻找一个解决方案当像素操作不那么快时非常快。

I know how can I do this by manipulating pixels, but I am looking for a solution that do this very fast when pixel manipulation is not that fast.

推荐答案

Mat outImg(inputImg.size(),inputImg.type());
inputImg(Rect(0, 0, shiftX, height)).copyTo(outImg(Rect(width-shiftX, 0, shiftX, height)));
inputImg(Rect(shiftX, 0, width-shiftX, height)).copyTo(outImg(Rect(0, 0, width-shiftX, height)));

这篇关于循环图像旋转在opencv中做什么是最好的方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆