title: OpenCv: Translate Image, Wrap Pixels Around Edges (C++)
body: <p>I am trying to translate an image horizontally by x pixels and vertically by y pixels, so . However, I want the pixels to wrap around the edges. Basically...</p>
  
  <p>we start with image one...
  <a href="https://i.stack.imgur.com/tcLUa.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tcLUa.jpg" alt=""></a></p>
  
  <p>shift by x pixels...
  <a href="https://i.stack.imgur.com/3dEvI.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/3dEvI.jpg" alt=""></a></p>
  
  <p>and shift by y pixels...
  <a href="https://i.stack.imgur.com/lYpzb.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/lYpzb.jpg" alt=""></a></p>
  
  <p>As far as I know, OpenCv's warpAffine() is not capable of doing this. Normally, I would just loop through the image and shift the pixels a certain amount, but in doing this I can only shift them horizontally. What is the most efficient way to go about this?</p>