Skip to content
Advertisement

How to merge two images in openCv(python)? [closed]

I extracted Red channel at this image

and I created a rectangle for this image

I want to blending as merge this two images and withoutRedChannel is should be positioned inside the rectangle

it is for extract red channel:

JavaScript

it is for rectangle:

JavaScript

my function’s full code here:

JavaScript

Advertisement

Answer

If you want to merge two images into one, you can do this:

JavaScript

where img is your full image and template is the cropped image. Be sure that both images have the same channels.

If your template image is in gray scale, you have to do this before to merged with the full image:

JavaScript

For your code, will be:

JavaScript
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement