简体   繁体   中英

copyTo doesn't work on OpenCv4Android

I would like to apply a mask with OpenCV4Android using the method copyTo(image, mask), but it is not working and the console doesn't show any errors.

Image1遮罩

图片2

Any idea?

maybe this is too late but I had the same problem and it was because my "src" had 3 Channels and my "dst" had 4 Channels.

I just wrote this:

Imgproc.cvtColor(src, auxiliar, Imgproc.COLOR_RGB2RGBA);
auxiliar.copyTo(dst, mask);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM