Ask Your Question

Yuugi's profile - activity

2017-04-07 17:15:05 -0600 answered a question imread in iOS

There's an native function for this.

#import <opencv2/imgcodecs/ios.h>

// t and m are UIImage* instances.
// transparentImage and maskImage are destination Mat.
// true/false is alpha condition.

UIImageToMat(t, transparentImage, true);
UIImageToMat(m, maskImage, true);