opencv - Mat::convertto() not working in javacv, android camera -
i developing android opencv app based on opencv4android sdk tutorial 2 - mixed processing.
in frame processing function public mat oncameraframe(cvcameraviewframe inputframe) {}
the frame rgba , want make rgb doing this:
mrgba = inputframe.rgba(); mgray = inputframe.gray(); mat mrgb=new mat(640,480,cvtype.cv_8uc3); mrgba.convertto(mrgb, cvtype.cv_8uc3); //imgproc.cvtcolor(mrgba, mrgb, cvtype.cv_8uc3); pinkimage(mrgb.dataaddr());
but when debug , log things passed jni part, find it's not working @ all. mrgb
cv_8uc4
after calling converto()
what cause of this?
ok, answer here
imgproc.cvtcolor(mrgba,mrgb,imgproc.color_rgba2rgb);
instead of
mrgba.convertto(mrgb, cvtype.cv_8uc3);
thanks lot!!
Comments
Post a Comment