Ask Your Question
0

Overlap Image in a specific way?_C++

asked 2018-07-23 04:02:36 -0600

JeyP4 gravatar image

updated 2018-07-23 04:29:17 -0600

How can following overlapping be performed? Image

Note: Mask can be created with any of R G B layer, because black areas are completely black, i.e. '0' for each R G B's. In this way efficiency can be improved.

In MATLAB this can be done with:

mask = (Im2> 0);           % masking 3 channels (computationally expensive)
Im1(mask) = Im2(mask);     % Im1 will become the final overlapped image
edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2018-07-23 04:16:13 -0600

LBerger gravatar image

updated 2018-07-23 04:52:24 -0600

Use copyTo :

overlappedIm = im1.clone();
im2.copyTo(overlappedIm ,mask);
edit flag offensive delete link more

Comments

Thnx And how to create the specific mask in opencv?

JeyP4 gravatar imageJeyP4 ( 2018-07-23 04:28:40 -0600 )edit
2

mask=Im2>0; cvtColor(mask,mask,COLOR_BGR2GRAY);

LBerger gravatar imageLBerger ( 2018-07-23 04:43:10 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2018-07-23 04:02:36 -0600

Seen: 401 times

Last updated: Jul 23 '18