Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

my guess(more a c++ guy, no idea about andoid ):

mat.convertTo(mat2, CvType.CV_8U); // it is probably not doing, what you want it to (mat2 might still have the original number of channels(4, most likely))

imho, you've got to pass a grayscale(1 channel,8bit) image to detectMultiScale in c++, i'd use

cvtColor(src,dst, CV_RGB2GRAY);

to achieve that, but no idea about the android wrapper here

my guess(more a c++ guy, no idea about andoid ):

mat.convertTo(mat2, CvType.CV_8U); CvType.CV_8U); // it this is probably not doing, what you want it to (mat2 to, as it's not changing the number of channels in the output img, so, mat2 might still have the original number of channels(4, most likely))likely)

imho, you've got to pass a grayscale(1 channel,8bit) image to detectMultiScale in c++, i'd use

cvtColor(src,dst, CV_RGB2GRAY);

to achieve that, but no idea about the android wrapper here