how to apply a texture to an area of image which has been marked already?

The first thing to say is that I only have coded OpenGL in a course 4-5 years ago at university, so my knowledge of OpenGL is very limited and what I’m asking is for a bigger project which needs some image processing and showing the output.
So I would be very thankful if anyone kindly and generously helps me to solve my problem.
Let’s say I have an image of a sofa and a region of interest marked red like below:
[ATTACH=CONFIG]1574[/ATTACH]
And let’s say I have fabric image like below:
[ATTACH=CONFIG]1575[/ATTACH]

The purpose is to cover the fabric image over the region of interest in the sofa image.
How can I accomplish this?

Thanks in advance

You’ll basically have to split the mesh of the sofa into different meshes. You’ll have to have a mesh for your marked region.
If your model (the sofa) does not have multiple meshes, modelers will generally help you to cut your model into different meshes.
One you have that, then use the texture only for this mesh.
You can consider a mesh to be a set of vertices, normals, colors, texture coordinates which share the same material properties (here your texture).

Another approach, which is more for artists, is to copy/paste your image portion at the UV positions where you want this texture to apply.

in terms of “image processing”, the marked region could also be determimed by its color (red for example). render full-screen quad: if fragment color’s red component > threshhold, use texture. or blend both images, using the source image’s red component as blending weight.

Nice solution !