Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.2k views
in Technique[技术] by (71.8m points)

wpf - round robin image rotation what is the best way to do in opencv

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

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

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.

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
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)));

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share

2.1m questions

2.1m answers

62 comments

56.7k users

...