Overlay png image over jpg using openv Java API

asked 2013-07-30 06:32:45 -0600

droidCV gravatar image

updated 2013-07-30 09:42:02 -0600

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 )

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 error over here

System configuration : Opencv4Android 2.4.5 , Opencv Manager 2.4.5

edit retag flag offensive close merge delete


Your question isn't a question. Basically you are saying, check my code and do my work. Please provide usefull information inside the question like mentioned in the FAQ. If you don't adapt the question, I will close it down.

StevenPuttemans gravatar imageStevenPuttemans ( 2013-07-30 07:02:10 -0600 )edit

May be instead of closing it down let other take a look at it as this is one of common issues faced on android while using opencv .As there is not much documentation available for JAVA API of opencv this is the way yo gain knowledge by sharing issue and asking help.

droidCV gravatar imagedroidCV ( 2013-07-30 09:01:13 -0600 )edit

You just don't get it ... I was talking about the fact that there isn't even a single error pasted, except for the fact you mention a nullpointer. Where did it happen? What line of code did you reached during your debug? What type of OpenCV your are using? Specify your system settings...

StevenPuttemans gravatar imageStevenPuttemans ( 2013-07-30 09:12:28 -0600 )edit
droidCV gravatar imagedroidCV ( 2013-07-31 09:05:36 -0600 )edit

Dear droidCV. I'm getting error on opacity = foreground.get(fY , fX)[3]; OutOfBoundsException 3. Should I format this two Mat's in special way ? Regards Jan

J-S gravatar imageJ-S ( 2013-08-15 15:05:37 -0600 )edit

@droidCV or @J-S I am having the same error opacity = foreground.get(fY , fX)[3]; OutOfBoundsException 3 .. how can I fix this issue?

delkant gravatar imagedelkant ( 2019-05-10 14:35:49 -0600 )edit