<p>This problem is called image outpainting and You can see very advanced deep learning based solutions in papers on <a href="https://paperswithcode.com/" rel="nofollow noreferrer">paperswithcode.com</a>. Current state-of-art is given by Basile Van Hoorick in work <a href="https://arxiv.org/pdf/1912.10960v2.pdf" rel="nofollow noreferrer">Image Outpainting and Harmonization using Generative Adversarial Networks</a>. Code with possibility of usage is placed in his <a href="https://github.com/basilevh/image-outpainting" rel="nofollow noreferrer">github profile</a>. See <em>Usage</em> section on github to know how to use it.</p>
<p>There are 3 models available to use in <em>Pretrained models</em> section:</p>
<ul>
<li>G_art.pt: Artistic</li>
<li>G_nat.pt: Natural</li>
<li>G_rec.pt: Reconstruction loss only (no adversarial loss)</li>
</ul>
<p>I believe You'll have to use transfer learning to train and use this architecture in Your use case.</p>
stretch the edges of any image data areas in python-opencv
<p>I'm trying to stretch the edges of the image (duplicate pixels) around data (not transparent) areas in picture.</p>
<p>for example:</p>
<p><strong>before:</strong>
<a href="https://i.stack.imgur.com/NaG2r.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/NaG2r.png" alt="before" /></a></p>
<p><strong>after - the red line is only for you to see the difference</strong>
<a href="https://i.stack.imgur.com/S8k9B.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/S8k9B.png" alt="after: (the red line is only for you to see the difference)" /></a></p>
<p><strong>note:</strong> it's important not to change the dimension of the image, i'ts being used for geographical needs.</p>
<p>I would like to hear any ideas or suggestions from you, code snippets will be welcomed.</p>
<p>thank you!</p>