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



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

LBerger gravatar imageLBerger ( 2018-07-04 10:05:40 -0500 )edit

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