Ask Your Question

Create a transparent Mat in Android

asked 2018-07-04 07:00:58 -0500

paatz04 gravatar image


I'm trying to create a transparent mat but somehow the alpha channel doesn't work right. This is what I'm doing right now:

Mat retFrame = new Mat(rows, cols, CvType.CV_8UC3, new Scalar(255,255, 255, 0));

I tried it with all kinds of alpha values Thanks!

edit retag flag offensive close merge delete


again alpha makes only sense when compositing 2 images.

opencv, being mainly a computer-vision library, has no builtin support for this.

berak gravatar imageberak ( 2018-07-05 10:01:56 -0500 )edit

1 answer

Sort by ยป oldest newest most voted

answered 2018-07-04 10:05:40 -0500

LBerger gravatar image

there is no transapnrent channel in image processing.

CvType.CV_8UC3, new Scalar(255,255, 255, 0) NO Scalar(255,255, 255, 0) four values so it is CvType.CV_8UC4

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower


Asked: 2018-07-04 07:00:58 -0500

Seen: 411 times

Last updated: Jul 04 '18