Ask Your Question
0

Create a transparent Mat in Android

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

paatz04 gravatar image

Hi,

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

Comments

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 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
1

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

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

Question Tools

1 follower

Stats

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

Seen: 1,025 times

Last updated: Jul 04 '18