Predict an image pattern (OpenCV)

Job ID: 32947370

Budget: €30 – €250 EUR

An image (photo) with a pattern is given. The task is to enlarge the image to one side with continuing this pattern. In other words it should be predicted how the pattern will continue.

So the input is:
- an image file (with a pattern)
- the side which should be enlarged (0, 1, 2, 3 for left, top right, bottom)
- the enlargement in pixel
The output is:
- the enlarged image file

The task has to be done with C++. Code should be fast and I need it for Embarcadero C++ Builder (but Visual Studio is fine, too).

As libraries, OpenCV can be used. If you want to use other libraries, you have to ask before.

I want to mention that it is NOT sufficient just to implement the inpaint function of OpenCV!

Here are some examples to show the idea. (Of course these are real images and it cannot be calculated exactly like this):
Input00.jpg -> enlargement top -> something like Output00.jpg
Input01.jpg -> enlargement right-> something like Output01.jpg
Input02.jpg -> enlargement top and bottom -> something like Output02.jpg