Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

The imread() functions allocates a new Mat, so the code should be like:

Mat cokeBGR = Highgui.imread("/mnt/sdcard/coke.bmp");
Mat cokeRGBA = new Mat();
Imgproc.cvtColor(cokeBGR, cokeRGBA, Imgproc.COLOR_BGR2RGBA);
Imgproc.resize(cokeRGBA, sm, sm.size());