FaceDetector error exists in btk_FaceFinder_putDCR

I am trying to detect a face from a camera image.

But it always ends with the following error:

ERROR: returns 0 faces because there is an error in btk_FaceFinder_putDCR.

My code is:

FaceDetector fd = new FaceDetector(bmp.getWidth(), bmp.getHeight(), 1); Face[] faces = new Face[1]; int nrOfFaces = fd.findFaces(bitmap565, faces); 

The only problem I see with this code is that I don’t know Bitmap Config and I don’t know how to convert Bitmap to Config.RGB_565 format.

Can anyone help?

+4
source share
4 answers

Image width MUST be even .

+12
source

After a lot of searching, you should put your images in the drawable-nodpi folder .

+3
source
 Bitmap bitmap565 = bmp.copy(Bitmap.Config.RGB_565, true); 
+1
source

According to the documentation of http://developers.android.com , if the image width does not exist, then this exception occurs.

For more details see the link:

http://developer.android.com/reference/android/media/FaceDetector.html

+1
source

Source: https://habr.com/ru/post/1381762/


All Articles