Ask Your Question
0

How to split cross an image ?

asked 2020-04-18 11:02:25 -0600

ziknehupsu gravatar image

updated 2020-04-18 11:23:40 -0600

Hello everyone,

I want to split an image, like this;

img

Can you help me ?

Thanks in advance.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2020-04-19 06:46:24 -0600

kbarni gravatar image

Well, you cannot have a non-rectangular image. Still, it is possible to create an image with the left part and another one with the right part.

Mat mask;   // put here a binary mask (0's and 1's) of the left area
Mat image;  //your original image
Mat leftpart,rightpart;
image.copyTo(leftpart,mask);
image.copyTo(rightpart,1-mask);
edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2020-04-18 11:02:25 -0600

Seen: 222 times

Last updated: Apr 19 '20