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

Categories

0 votes
1.3k 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 Reply

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)));

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...