Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Overlay png image over jpg using openv Java API

I am trying to convert the following code written in C++ into JAVA equivalent for android platform. The code is from the site : http://jepsonsblog.blogspot.in/2012/10/overlay-transparent-image-in-opencv.html

C++ : http://pastebin.com/0Hi4dUPB JAVA : http://pastebin.com/UShpC9MY

So far I came accross errors like NullPoninter Exception , Mat type not compatible etc.

Overlay png image over jpg using openv Java API

I am trying to convert the following code written in C++ into JAVA equivalent for android platform. The code is from the site : http://jepsonsblog.blogspot.in/2012/10/overlay-transparent-image-in-opencv.html

C++ : http://pastebin.com/0Hi4dUPB JAVA : http://pastebin.com/UShpC9MY ( contain error description )

So far I came accross errors like NullPoninter Exception below method is suggested at How to get and modify the pixel of Mat in Java?

double[] opacity = new double[(int) (foreground.total()*foreground.channels())];
foreground.get(fY , fX, opacity);/// Mat type not compatible etc.error over here

System configuration : Opencv4Android 2.4.5 , Opencv Manager 2.4.5