我想使用 Google ML Kit 和 CameraX API 制作实时图像分类器。我正在使用 CameraX API 的预览和分析。它给出的错误为
2020-07-27 01:17:18.145 11009-11009/com.example.camerax_automl W/System.err: Caused by: java.lang.IllegalStateException: Image is already closed
2020-07-27 01:17:18.145 11009-11009/com.example.camerax_automl W/System.err: at android.media.Image.throwISEIfImageIsInvalid(Image.java:68)
2020-07-27 01:17:18.145 11009-11009/com.example.camerax_automl W/System.err: at android.media.ImageReader$SurfaceImage$SurfacePlane.getBuffer(ImageReader.java:832)
2020-07-27 01:17:18.145 11009-11009/com.example.camerax_automl W/System.err: at com.google.mlkit.vision.common.internal.ImageConvertUtils.zza(com.google.mlkit:vision-common@@16.0.0:139)
2020-07-27 01:17:18.145 11009-11009/com.example.camerax_automl W/System.err: at com.google.mlkit.vision.common.internal.ImageConvertUtils.convertToUpRightBitmap(com.google.mlkit:vision-common@@16.0.0:89)
2020-07-27 01:17:18.145 11009-11009/com.example.camerax_automl W/System.err: at com.google.mlkit.vision.common.internal.ImageConvertUtils.getUpRightBitmap(com.google.mlkit:vision-common@@16.0.0:10)
2020-07-27 01:17:18.145 11009-11009/com.example.camerax_automl W/System.err: at com.google.mlkit.vision.label.automl.internal.zzo.zza(com.google.mlkit:image-labeling-automl@@16.0.0:16)
2020-07-27 01:17:18.145 11009-11009/com.example.camerax_automl W/System.err: at com.google.mlkit.vision.label.automl.internal.zzo.run(com.google.mlkit:image-labeling-automl@@16.0.0:60)
2020-07-27 01:17:18.145 11009-11009/com.example.camerax_automl W/System.err: at com.google.mlkit.vision.common.internal.MobileVisionBase.zza(com.google.mlkit:vision-common@@16.0.0:23)
2020-07-27 01:17:18.146 11009-11009/com.example.camerax_automl W/System.err: at com.google.mlkit.vision.common.internal.zzb.call(com.google.mlkit:vision-common@@16.0.0)
2020-07-27 01:17:18.146 11009-11009/com.example.camerax_automl W/System.err: …
Run Code Online (Sandbox Code Playgroud)