Ami*_*raj 5 android azure microsoft-cognitive face-api
我正在尝试在Android上使用Azure Face API。我正在从设备相机捕获图像,然后将其转换为InputStream以发送到detect方法。我不断收到错误“ com.microsoft.projectoxford.face.rest.ClientException:图像大小太小”
我检查了文档,图像大小为1.4Mb,在1Kb-4Mb范围内。我不明白为什么它不起作用。
Bitmap bitmap = cameraKitImage.getBitmap();
ByteArrayOutputStream bos = new ByteArrayOutputStream();
bitmap.compress(Bitmap.CompressFormat.PNG, 100, bos);
bitmapdata = bos.toByteArray();
new FaceTask().execute(new ByteArrayInputStream(bitmapdata));
Face[] faces = faceServiceClient.detect(inputStreams[0], true, false, null);
Run Code Online (Sandbox Code Playgroud)